#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 alaw2linear(int);
int /*<<< orphan*/ printf(char *, ...);
int ulaw2linear(int);
int main(int argc, char **argv) {
  int i;
  printf("/* THIS SOURCE CODE IS AUTOMATICALLY GENERATED - DO NOT MODIFY */\n");
  printf(
      "/*\n"
      " * V90 tables\n"
      " * \n"
      " * Copyright (c) 1999 Fabrice Bellard.\n"
      " *\n"
      " * This code is released under the GNU General Public License version\n"
      " * 2. Please read the file COPYING to know the exact terms of the\n"
      " * license.\n"
      " */\n");
  printf("#include \"lm.h\"\n"
         "#include \"v90priv.h\"\n"
         "\n");
  printf("const s16 v90_ulaw_ucode_to_linear[128]= {\n");
  for (i = 0; i < 128; i++) {
    printf("%5d,", ulaw2linear(i ^ 0xff));
    if ((i & 7) == 7)
      printf("\n");
  }
  printf("};\n");
  printf("const s16 v90_alaw_ucode_to_linear[128]= {\n");
  for (i = 0; i < 128; i++) {
    printf("%5d,", alaw2linear(i ^ 0xd5));
    if ((i & 7) == 7)
      printf("\n");
  }
  printf("};\n");
  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)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xfb2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xfcb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x80,-0x14(%rbp)
jge    11e0 <main+0xb0>
mov    -0x14(%rbp),%edi
xor    $0xff,%edi
call   1040 <ulaw2linear@plt>
mov    %eax,%esi
lea    0xfc5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
and    $0x7,%eax
cmp    $0x7,%eax
jne    11cd <main+0x9d>
lea    0xf7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11d2 <main+0xa2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1185 <main+0x55>
lea    0xf8c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x80,-0x14(%rbp)
jge    125e <main+0x12e>
mov    -0x14(%rbp),%edi
xor    $0xd5,%edi
call   1030 <alaw2linear@plt>
mov    %eax,%esi
lea    0xf47(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
and    $0x7,%eax
cmp    $0x7,%eax
jne    124b <main+0x11b>
lea    0xefc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1250 <main+0x120>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1203 <main+0xd3>
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xeab(%rip),%rdi
call   1050 <puts@plt>
lea    0xee1(%rip),%rdi
call   1050 <puts@plt>
lea    0xfac(%rip),%rdi
call   1050 <puts@plt>
lea    0xfc6(%rip),%rdi
call   1050 <puts@plt>
lea    0xe76(%rip),%rbx
xor    %ebp,%ebp
jmp    119b <main+0x4b>
xchg   %ax,%ax
add    $0x1,%ebp
cmp    $0x80,%ebp
je     11c8 <main+0x78>
mov    %ebp,%edi
xor    $0xff,%edi
call   1060 <ulaw2linear@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebp,%eax
not    %eax
test   $0x7,%al
jne    1190 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1190 <main+0x40>
lea    0xfcb(%rip),%rdi
call   1050 <puts@plt>
lea    0xf94(%rip),%rdi
call   1050 <puts@plt>
lea    0xe19(%rip),%rbx
xor    %ebp,%ebp
jmp    11fb <main+0xab>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    $0x80,%ebp
je     1228 <main+0xd8>
mov    %ebp,%edi
xor    $0xd5,%edi
call   1040 <alaw2linear@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebp,%eax
not    %eax
test   $0x7,%al
jne    11f0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11f0 <main+0xa0>
lea    0xf6b(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [67 x i8] c"/* THIS SOURCE CODE IS AUTOMATICALLY GENERATED - DO NOT MODIFY */\0A\00"
@.str.1 = [216 x i8] c"/*\0A * V90 tables\0A * \0A * Copyright (c) 1999 Fabrice Bellard.\0A *\0A * This code is released under the GNU General Public License version\0A * 2. Please read the file COPYING to know the exact terms of the\0A * license.\0A */\0A\00"
@.str.2 = [39 x i8] c"#include \22lm.h\22\0A#include \22v90priv.h\22\0A\0A\00"
@.str.3 = [44 x i8] c"const s16 v90_ulaw_ucode_to_linear[128]= {\0A\00"
@.str.4 = [5 x i8] c"%5d,\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [4 x i8] c"};\0A\00"
@.str.7 = [44 x i8] c"const s16 v90_alaw_ucode_to_linear[128]= {\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %6
br label %11
11: ; preds = %25, %2
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 128
br i1 %13, label %14, label %28
14: ; preds = %11
%15 = load i32, i32* %6
%16 = xor i32 %15, 255
%17 = call i32 @ulaw2linear(i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %6
%20 = and i32 %19, 7
%21 = icmp eq i32 %20, 7
br i1 %21, label %22, label %24
22: ; preds = %14
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %24
24: ; preds = %22, %14
br label %25
25: ; preds = %24
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %11
28: ; preds = %11
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %6
br label %31
31: ; preds = %45, %28
%32 = load i32, i32* %6
%33 = icmp slt i32 %32, 128
br i1 %33, label %34, label %48
34: ; preds = %31
%35 = load i32, i32* %6
%36 = xor i32 %35, 213
%37 = call i32 @alaw2linear(i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %6
%40 = and i32 %39, 7
%41 = icmp eq i32 %40, 7
br i1 %41, label %42, label %44
42: ; preds = %34
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %44
44: ; preds = %42, %34
br label %45
45: ; preds = %44
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
br label %31
48: ; preds = %31
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [5 x i8] c"%5d,\00"
@str = [66 x i8] c"/* THIS SOURCE CODE IS AUTOMATICALLY GENERATED - DO NOT MODIFY */\00"
@str.8 = [215 x i8] c"/*\0A * V90 tables\0A * \0A * Copyright (c) 1999 Fabrice Bellard.\0A *\0A * This code is released under the GNU General Public License version\0A * 2. Please read the file COPYING to know the exact terms of the\0A * license.\0A */\00"
@str.9 = [38 x i8] c"#include \22lm.h\22\0A#include \22v90priv.h\22\0A\00"
@str.10 = [43 x i8] c"const s16 v90_ulaw_ucode_to_linear[128]= {\00"
@str.12 = [43 x i8] c"const s16 v90_alaw_ucode_to_linear[128]= {\00"
@str.13 = [3 x i8] c"};\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([215 x i8], [215 x i8]* @str.8, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.9, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.10, i64 0, i64 0))
br label %7
7: ; preds = %2, %16
%8 = phi i32 [ 0, %2 ], [ %17, %16 ]
%9 = xor i32 %8, 255
%10 = tail call i32 @ulaw2linear(i32 %9)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %10)
%12 = and i32 %8, 7
%13 = icmp eq i32 %12, 7
br i1 %13, label %14, label %16
14: ; preds = %7
%15 = tail call i32 @putchar(i32 10)
br label %16
16: ; preds = %7, %14
%17 = add nuw nsw i32 %8, 1
%18 = icmp eq i32 %17, 128
br i1 %18, label %19, label %7
19: ; preds = %16
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.13, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.12, i64 0, i64 0))
br label %22
22: ; preds = %19, %31
%23 = phi i32 [ 0, %19 ], [ %32, %31 ]
%24 = xor i32 %23, 213
%25 = tail call i32 @alaw2linear(i32 %24)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = and i32 %23, 7
%28 = icmp eq i32 %27, 7
br i1 %28, label %29, label %31
29: ; preds = %22
%30 = tail call i32 @putchar(i32 10)
br label %31
31: ; preds = %22, %29
%32 = add nuw nsw i32 %23, 1
%33 = icmp eq i32 %32, 128
br i1 %33, label %34, label %22
34: ; preds = %31
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.13, i64 0, i64 0))
ret i32 0
}