#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*/ exit(int);
int /*<<< orphan*/ g721_test();
int /*<<< orphan*/ g723_test(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int bDoAll = 0;
  int nTests = 0;
  if (argc != 2) {
    printf("Usage : %s <test>\n", argv[0]);
    printf("    Where <test> is one of the following:\n");
    printf("           g721  - test G721 encoder and decoder\n");
    printf("           g723  - test G721 encoder and decoder\n");
    printf("           all   - perform all tests\n");
    exit(1);
  };
  bDoAll = !strcmp(argv[1], "all");
  if (bDoAll || !strcmp(argv[1], "g721")) {
    g721_test();
    nTests++;
  };
  if (bDoAll || !strcmp(argv[1], "g723")) {
    g723_test(0.53);
    nTests++;
  };
  if (nTests == 0) {
    printf("Mono : ************************************\n");
    printf("Mono : *  No '%s' test defined.\n", argv[1]);
    printf("Mono : ************************************\n");
    return 1;
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11d5 <main+0x85>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeec(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1220 <main+0xd0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xec2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1230 <main+0xe0>
mov    $0x0,%al
call   1060 <g721_test@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1257 <main+0x107>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe90(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    126d <main+0x11d>
movsd  0xda1(%rip),%xmm0
call   1050 <g723_test@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    12b5 <main+0x165>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12bc <main+0x16c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
cmp    $0x2,%edi
jne    121c <main+0xbc>
mov    0x8(%r14),%rbx
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11dd <main+0x7d>
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11fd <main+0x9d>
lea    0xe83(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11e4 <main+0x84>
lea    0xe96(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    0x8(%r14),%rsi
lea    0xe62(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
jmp    11f3 <main+0x93>
xor    %eax,%eax
call   1070 <g721_test@plt>
movsd  0xe14(%rip),%xmm0
call   1060 <g723_test@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <g721_test@plt>
mov    0x8(%r14),%rdi
lea    0xe13(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    11f3 <main+0x93>
jmp    11e4 <main+0x84>
mov    (%r14),%rsi
lea    0xde2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe42(%rip),%rdi
call   1030 <puts@plt>
lea    0xe60(%rip),%rdi
call   1030 <puts@plt>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Usage : %s <test>\0A\00"
@.str.1 = [43 x i8] c" Where <test> is one of the following:\0A\00"
@.str.2 = [50 x i8] c" g721 - test G721 encoder and decoder\0A\00"
@.str.3 = [50 x i8] c" g723 - test G721 encoder and decoder\0A\00"
@.str.4 = [38 x i8] c" all - perform all tests\0A\00"
@.str.5 = [4 x i8] c"all\00"
@.str.6 = [5 x i8] c"g721\00"
@.str.7 = [5 x i8] c"g723\00"
@.str.8 = [45 x i8] c"Mono : ************************************\0A\00"
@.str.9 = [33 x i8] c"Mono : * No '%s' test defined.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @strcmp(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
%26 = xor i1 %25, true
%27 = zext i1 %26 to i32
store i32 %27, i32* %6
%28 = load i32, i32* %6
%29 = icmp ne i32 %28, 0
br i1 %29, label %36, label %30
30: ; preds = %20
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %40, label %36
36: ; preds = %30, %20
%37 = call i32 (...) @g721_test()
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %40
40: ; preds = %36, %30
%41 = load i32, i32* %6
%42 = icmp ne i32 %41, 0
br i1 %42, label %49, label %43
43: ; preds = %40
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
%47 = call i32 @strcmp(i8* %46, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%48 = icmp ne i32 %47, 0
br i1 %48, label %53, label %49
49: ; preds = %43, %40
%50 = call i32 @g723_test(double 5.300000e-01)
%51 = load i32, i32* %7
%52 = add nsw i32 %51, 1
store i32 %52, i32* %7
br label %53
53: ; preds = %49, %43
%54 = load i32, i32* %7
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %63
56: ; preds = %53
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 1
%60 = load i8*, i8** %59
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i8* %60)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %3
br label %64
63: ; preds = %53
store i32 0, i32* %3
br label %64
64: ; preds = %63, %56
%65 = load i32, i32* %3
ret i32 %65
}

LLVM IR (-O2):
@.str = [19 x i8] c"Usage : %s <test>\0A\00"
@.str.5 = [4 x i8] c"all\00"
@.str.6 = [5 x i8] c"g721\00"
@.str.7 = [5 x i8] c"g723\00"
@.str.9 = [33 x i8] c"Mono : * No '%s' test defined.\0A\00"
@str.10 = [44 x i8] c"Mono : ************************************\00"
@str.11 = [42 x i8] c" Where <test> is one of the following:\00"
@str.12 = [49 x i8] c" g721 - test G721 encoder and decoder\00"
@str.13 = [49 x i8] c" g723 - test G721 encoder and decoder\00"
@str.14 = [37 x i8] c" all - perform all tests\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.11, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.12, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.13, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.14, i64 0, i64 0))
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32 @strcmp(i8* dereferenceable(1) %14, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = tail call i32 (...) @g721_test()
br label %30
19: ; preds = %12
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %14, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = tail call i32 (...) @g721_test()
%24 = load i8*, i8** %13
%25 = tail call i32 @strcmp(i8* dereferenceable(1) %24, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %30, label %37
27: ; preds = %19
%28 = tail call i32 @strcmp(i8* dereferenceable(1) %14, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %27, %22, %17
%31 = tail call i32 @g723_test(double 5.300000e-01)
br label %37
32: ; preds = %27
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.10, i64 0, i64 0))
%34 = load i8*, i8** %13
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i8* %34)
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.10, i64 0, i64 0))
br label %37
37: ; preds = %22, %30, %32
%38 = phi i32 [ 1, %32 ], [ 0, %30 ], [ 0, %22 ]
ret i32 %38
}