#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*/ printf(char *);
void print_head(void) {
  printf("// ShaderTracker: Ridiculous shader summation sound engine\n");
  printf("// Engine / Function Builder by Michael Moffitt "
         "(https://github.com/mikejmoffitt)\n");
  printf("// Sound Generation Functions by Gerard Geer "
         "(https://github.com/gerard-geer)\n");
  printf("// Waveform definitions\n\n");
  printf("float saw(float t, float f, float a)\n");
  printf("{\n\treturn ((mod(t*0.5*f*0.31830989, 1.0)*2.0)-1.0)*a;\n}\n\n");
  printf("float sqr(float t, float f, float duty, float a)\n");
  printf("{\n\treturn step(duty, abs(saw(t,f * 0.5,1.0)))*a;\n}\n\n");
  printf("float tri(float t, float f, float a)\n");
  printf("{\n\treturn (((floor(abs(saw(t,f * "
         "0.5,a))*16.0)*0.0625)*2.0)-1.0)*a;\n}\n\n");
  printf("float sine(float t, float f, float a)\n");
  printf("{\n\treturn sin(t*f)*a;\n}\n\n");
  printf("float noise(float t, float f, float a)\n");
  printf("{\n\treturn "
         "((fract(sin(dot(vec2(t,f),vec2(12.9898,78.233)))*43758.5453)*2.0)-1."
         "0)*a;\n}\n\n");
  printf("float l_decay(float t, float s, float l)\n");
  printf("{\n\treturn clamp(1.0-((t-s)/l), 0.0, 1.0);\n}\n\n");
  printf("float fm_bell(float t, float f, float a)\n");
  printf("{\n\tf = f / 2.0;");
  printf("\n\treturn a * sin(t * 2.0 * f + sin(5.0 * t * 2.0 * f));");
  printf("\n}\n\n");
}


x86 assembly (clang, -O0):
<print_head>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf9f(%rip),%rdi
call   1030 <printf@plt>
lea    0xfad(%rip),%rdi
call   1030 <printf@plt>
lea    0xfc7(%rip),%rdi
call   1030 <printf@plt>
lea    0xff5(%rip),%rdi
call   1030 <printf@plt>
lea    0x101b(%rip),%rdi
call   1030 <printf@plt>
lea    0x1044(%rip),%rdi
call   1030 <printf@plt>
lea    0x105e(%rip),%rdi
call   1030 <printf@plt>
lea    0x109a(%rip),%rdi
call   1030 <printf@plt>
lea    0x10b5(%rip),%rdi
call   1030 <printf@plt>
lea    0x10c3(%rip),%rdi
call   1030 <printf@plt>
lea    0x10df(%rip),%rdi
call   1030 <printf@plt>
lea    0x112b(%rip),%rdi
call   1030 <printf@plt>
lea    0x1149(%rip),%rdi
call   1030 <printf@plt>
lea    0x116b(%rip),%rdi
call   1030 <printf@plt>
lea    0x1189(%rip),%rdi
call   1030 <printf@plt>
lea    0x118d(%rip),%rdi
call   1030 <printf@plt>
lea    0x1142(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_head>:
push   %rax
lea    0xf20(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf95(%rip),%rdi
call   1030 <puts@plt>
lea    0xfd7(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe4(%rip),%rdi
call   1030 <puts@plt>
lea    0xffd(%rip),%rdi
call   1030 <puts@plt>
lea    0x102a(%rip),%rdi
call   1030 <puts@plt>
lea    0x104f(%rip),%rdi
call   1030 <puts@plt>
lea    0x1077(%rip),%rdi
call   1030 <puts@plt>
lea    0x1090(%rip),%rdi
call   1030 <puts@plt>
lea    0x10cb(%rip),%rdi
call   1030 <puts@plt>
lea    0x10e5(%rip),%rdi
call   1030 <puts@plt>
lea    0x10f2(%rip),%rdi
call   1030 <puts@plt>
lea    0x110d(%rip),%rdi
call   1030 <puts@plt>
lea    0x1158(%rip),%rdi
call   1030 <puts@plt>
lea    0x1175(%rip),%rdi
call   1030 <puts@plt>
lea    0x1196(%rip),%rdi
call   1030 <puts@plt>
lea    0xe0c(%rip),%rdi
call   1040 <printf@plt>
lea    0xe10(%rip),%rdi
call   1040 <printf@plt>
lea    0x116e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"// ShaderTracker: Ridiculous shader summation sound engine\0A\00"
@.str.1 = [83 x i8] c"// Engine / Function Builder by Michael Moffitt (https://github.com/mikejmoffitt)\0A\00"
@.str.2 = [79 x i8] c"// Sound Generation Functions by Gerard Geer (https://github.com/gerard-geer)\0A\00"
@.str.3 = [26 x i8] c"// Waveform definitions\0A\0A\00"
@.str.4 = [38 x i8] c"float saw(float t, float f, float a)\0A\00"
@.str.5 = [58 x i8] c"{\0A\09return ((mod(t*0.5*f*0.31830989, 1.0)*2.0)-1.0)*a;\0A}\0A\0A\00"
@.str.6 = [50 x i8] c"float sqr(float t, float f, float duty, float a)\0A\00"
@.str.7 = [53 x i8] c"{\0A\09return step(duty, abs(saw(t,f * 0.5,1.0)))*a;\0A}\0A\0A\00"
@.str.8 = [38 x i8] c"float tri(float t, float f, float a)\0A\00"
@.str.9 = [72 x i8] c"{\0A\09return (((floor(abs(saw(t,f * 0.5,a))*16.0)*0.0625)*2.0)-1.0)*a;\0A}\0A\0A\00"
@.str.10 = [39 x i8] c"float sine(float t, float f, float a)\0A\00"
@.str.11 = [26 x i8] c"{\0A\09return sin(t*f)*a;\0A}\0A\0A\00"
@.str.12 = [40 x i8] c"float noise(float t, float f, float a)\0A\00"
@.str.13 = [88 x i8] c"{\0A\09return ((fract(sin(dot(vec2(t,f),vec2(12.9898,78.233)))*43758.5453)*2.0)-1.0)*a;\0A}\0A\0A\00"
@.str.14 = [42 x i8] c"float l_decay(float t, float s, float l)\0A\00"
@.str.15 = [46 x i8] c"{\0A\09return clamp(1.0-((t-s)/l), 0.0, 1.0);\0A}\0A\0A\00"
@.str.16 = [42 x i8] c"float fm_bell(float t, float f, float a)\0A\00"
@.str.17 = [16 x i8] c"{\0A\09f = f / 2.0;\00"
@.str.18 = [56 x i8] c"\0A\09return a * sin(t * 2.0 * f + sin(5.0 * t * 2.0 * f));\00"
@.str.19 = [5 x i8] c"\0A}\0A\0A\00"
define void @print_head() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.12, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.13, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.14, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.15, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.16, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.18, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.17 = [16 x i8] c"{\0A\09f = f / 2.0;\00"
@.str.18 = [56 x i8] c"\0A\09return a * sin(t * 2.0 * f + sin(5.0 * t * 2.0 * f));\00"
@str = [59 x i8] c"// ShaderTracker: Ridiculous shader summation sound engine\00"
@str.20 = [82 x i8] c"// Engine / Function Builder by Michael Moffitt (https://github.com/mikejmoffitt)\00"
@str.21 = [78 x i8] c"// Sound Generation Functions by Gerard Geer (https://github.com/gerard-geer)\00"
@str.22 = [25 x i8] c"// Waveform definitions\0A\00"
@str.23 = [37 x i8] c"float saw(float t, float f, float a)\00"
@str.24 = [57 x i8] c"{\0A\09return ((mod(t*0.5*f*0.31830989, 1.0)*2.0)-1.0)*a;\0A}\0A\00"
@str.25 = [49 x i8] c"float sqr(float t, float f, float duty, float a)\00"
@str.26 = [52 x i8] c"{\0A\09return step(duty, abs(saw(t,f * 0.5,1.0)))*a;\0A}\0A\00"
@str.27 = [37 x i8] c"float tri(float t, float f, float a)\00"
@str.28 = [71 x i8] c"{\0A\09return (((floor(abs(saw(t,f * 0.5,a))*16.0)*0.0625)*2.0)-1.0)*a;\0A}\0A\00"
@str.29 = [38 x i8] c"float sine(float t, float f, float a)\00"
@str.30 = [25 x i8] c"{\0A\09return sin(t*f)*a;\0A}\0A\00"
@str.31 = [39 x i8] c"float noise(float t, float f, float a)\00"
@str.32 = [87 x i8] c"{\0A\09return ((fract(sin(dot(vec2(t,f),vec2(12.9898,78.233)))*43758.5453)*2.0)-1.0)*a;\0A}\0A\00"
@str.33 = [41 x i8] c"float l_decay(float t, float s, float l)\00"
@str.34 = [45 x i8] c"{\0A\09return clamp(1.0-((t-s)/l), 0.0, 1.0);\0A}\0A\00"
@str.35 = [41 x i8] c"float fm_bell(float t, float f, float a)\00"
@str.36 = [4 x i8] c"\0A}\0A\00"
define void @print_head() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.20, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.21, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.22, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.23, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.24, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.25, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.26, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.27, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.28, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.29, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.30, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.31, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @str.32, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.33, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.34, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.35, i64 0, i64 0))
%18 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0))
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.18, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.36, i64 0, i64 0))
ret void
}