#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*/ codeln(char *);
int /*<<< orphan*/ commentln(char *);
int /*<<< orphan*/ ini_biased();
int /*<<< orphan*/ popIndent();
int /*<<< orphan*/ pushIndent();
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ vspace(int);
void legacyInit() {
  char buf[512];
  vspace(3);
  commentln("Legacy function");
  codeln("void initPreamp (void *pa, void *m) {");
  pushIndent();
  codeln("struct b_preamp *pp = (struct b_preamp *) pa;");
  codeln("mixFilterWeights (pa, ipwdef, aaldef);");
  sprintf(buf,
          "useMIDIControlFunction (m, \"xov.ctl_biased\", ctl_biased, pa);");
  codeln(buf);
  sprintf(
      buf,
      "useMIDIControlFunction (m, \"xov.ctl_biased_fb\", ctl_biased_fb, pa);");
  codeln(buf);
  sprintf(buf, "useMIDIControlFunction (m, \"xov.ctl_biased_fb2\", "
               "ctl_biased_fb2, pa);");
  codeln(buf);
  sprintf(buf, "useMIDIControlFunction (m, \"xov.ctl_biased_gfb\", "
               "ctl_biased_gfb, pa);");
  codeln(buf);
  sprintf(
      buf,
      "useMIDIControlFunction (m, \"xov.ctl_sagtobias\", ctl_sagtoBias, pa);");
  codeln(buf);
  sprintf(buf, "useMIDIControlFunction (m, \"overdrive.character\", "
               "ctl_biased_fat, pa);");
  codeln(buf);
  ini_biased();
  sprintf(buf,
          "useMIDIControlFunction (m, \"overdrive.enable\", setCleanCC, pa);");
  codeln(buf);
  sprintf(
      buf,
      "useMIDIControlFunction (m, \"overdrive.inputgain\", setInputGain, pa);");
  codeln(buf);
  sprintf(buf, "useMIDIControlFunction (m, \"overdrive.outputgain\", "
               "setOutputGain, pa);");
  codeln(buf);
  popIndent();
  codeln("}");
}


x86 assembly (clang, -O0):
<legacyInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
mov    $0x3,%edi
call   1060 <vspace@plt>
lea    0xe74(%rip),%rdi
call   1050 <commentln@plt>
lea    0xe78(%rip),%rdi
call   1040 <codeln@plt>
mov    $0x0,%al
call   1030 <pushIndent@plt>
lea    0xe8b(%rip),%rdi
call   1040 <codeln@plt>
lea    0xead(%rip),%rdi
call   1040 <codeln@plt>
lea    -0x200(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1090 <sprintf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <codeln@plt>
lea    -0x200(%rbp),%rdi
lea    0xee0(%rip),%rsi
call   1090 <sprintf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <codeln@plt>
lea    -0x200(%rbp),%rdi
lea    0xf05(%rip),%rsi
call   1090 <sprintf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <codeln@plt>
lea    -0x200(%rbp),%rdi
lea    0xf2c(%rip),%rsi
call   1090 <sprintf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <codeln@plt>
lea    -0x200(%rbp),%rdi
lea    0xf53(%rip),%rsi
call   1090 <sprintf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <codeln@plt>
lea    -0x200(%rbp),%rdi
lea    0xf78(%rip),%rsi
call   1090 <sprintf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <codeln@plt>
mov    $0x0,%al
call   1080 <ini_biased@plt>
lea    -0x200(%rbp),%rdi
lea    0xf99(%rip),%rsi
call   1090 <sprintf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <codeln@plt>
lea    -0x200(%rbp),%rdi
lea    0xfba(%rip),%rsi
call   1090 <sprintf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <codeln@plt>
lea    -0x200(%rbp),%rdi
lea    0xfe0(%rip),%rsi
call   1090 <sprintf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <codeln@plt>
mov    $0x0,%al
call   1070 <popIndent@plt>
lea    0x1008(%rip),%rdi
call   1040 <codeln@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<legacyInit>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    $0x3,%edi
call   1060 <vspace@plt>
lea    0xe85(%rip),%rdi
call   1050 <commentln@plt>
lea    0xe89(%rip),%rdi
call   1040 <codeln@plt>
xor    %eax,%eax
call   1030 <pushIndent@plt>
lea    0xe9c(%rip),%rdi
call   1040 <codeln@plt>
lea    0xebe(%rip),%rdi
call   1040 <codeln@plt>
movups 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xede(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xee2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xee4(%rip),%xmm0
movups %xmm0,0x2e(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <codeln@plt>
movups 0xedd(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xee2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xee6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xeea(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movl   $0x3b2961,0x40(%rsp)
mov    %r14,%rdi
call   1040 <codeln@plt>
movabs $0x3b296170202c32,%rax
mov    %rax,0x3e(%rsp)
movups 0xed3(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xedc(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xee0(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %r14,%rdi
call   1040 <codeln@plt>
movabs $0x3b296170202c62,%rax
mov    %rax,0x3e(%rsp)
movups 0xed3(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xedc(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xee0(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %r14,%rdi
call   1040 <codeln@plt>
movups 0xee2(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xee7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xeeb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xeef(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movl   $0x3b2961,0x40(%rsp)
mov    %r14,%rdi
call   1040 <codeln@plt>
movabs $0x3b296170202c74,%rax
mov    %rax,0x3f(%rsp)
movups 0xed8(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xee1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xee5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %r14,%rdi
call   1040 <codeln@plt>
xor    %eax,%eax
call   1080 <ini_biased@plt>
movups 0xee1(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xee6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xeea(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xeee(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %r14,%rdi
call   1040 <codeln@plt>
movabs $0x3b296170202c6e,%rbx
mov    %rbx,0x3d(%rsp)
movups 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xee0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xee4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xee8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %r14,%rdi
call   1040 <codeln@plt>
mov    %rbx,0x3f(%rsp)
movups 0xee4(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xeed(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xef1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %r14,%rdi
call   1040 <codeln@plt>
xor    %eax,%eax
call   1070 <popIndent@plt>
lea    0xeed(%rip),%rdi
call   1040 <codeln@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Legacy function\00"
@.str.1 = [38 x i8] c"void initPreamp (void *pa, void *m) {\00"
@.str.2 = [46 x i8] c"struct b_preamp *pp = (struct b_preamp *) pa;\00"
@.str.3 = [39 x i8] c"mixFilterWeights (pa, ipwdef, aaldef);\00"
@.str.4 = [62 x i8] c"useMIDIControlFunction (m, \22xov.ctl_biased\22, ctl_biased, pa);\00"
@.str.5 = [68 x i8] c"useMIDIControlFunction (m, \22xov.ctl_biased_fb\22, ctl_biased_fb, pa);\00"
@.str.6 = [70 x i8] c"useMIDIControlFunction (m, \22xov.ctl_biased_fb2\22, ctl_biased_fb2, pa);\00"
@.str.7 = [70 x i8] c"useMIDIControlFunction (m, \22xov.ctl_biased_gfb\22, ctl_biased_gfb, pa);\00"
@.str.8 = [68 x i8] c"useMIDIControlFunction (m, \22xov.ctl_sagtobias\22, ctl_sagtoBias, pa);\00"
@.str.9 = [71 x i8] c"useMIDIControlFunction (m, \22overdrive.character\22, ctl_biased_fat, pa);\00"
@.str.10 = [64 x i8] c"useMIDIControlFunction (m, \22overdrive.enable\22, setCleanCC, pa);\00"
@.str.11 = [69 x i8] c"useMIDIControlFunction (m, \22overdrive.inputgain\22, setInputGain, pa);\00"
@.str.12 = [71 x i8] c"useMIDIControlFunction (m, \22overdrive.outputgain\22, setOutputGain, pa);\00"
@.str.13 = [2 x i8] c"}\00"
define void @legacyInit() {
%1 = alloca [512 x i8]
%2 = call i32 @vspace(i32 3)
%3 = call i32 @commentln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @codeln(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @pushIndent()
%6 = call i32 @codeln(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @codeln(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%9 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.4, i64 0, i64 0))
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%11 = call i32 @codeln(i8* %10)
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%13 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.5, i64 0, i64 0))
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%15 = call i32 @codeln(i8* %14)
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%17 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.6, i64 0, i64 0))
%18 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%19 = call i32 @codeln(i8* %18)
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%21 = call i32 @sprintf(i8* %20, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.7, i64 0, i64 0))
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%23 = call i32 @codeln(i8* %22)
%24 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%25 = call i32 @sprintf(i8* %24, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.8, i64 0, i64 0))
%26 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%27 = call i32 @codeln(i8* %26)
%28 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%29 = call i32 @sprintf(i8* %28, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.9, i64 0, i64 0))
%30 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%31 = call i32 @codeln(i8* %30)
%32 = call i32 (...) @ini_biased()
%33 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%34 = call i32 @sprintf(i8* %33, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.10, i64 0, i64 0))
%35 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%36 = call i32 @codeln(i8* %35)
%37 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%38 = call i32 @sprintf(i8* %37, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.11, i64 0, i64 0))
%39 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%40 = call i32 @codeln(i8* %39)
%41 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%42 = call i32 @sprintf(i8* %41, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.12, i64 0, i64 0))
%43 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%44 = call i32 @codeln(i8* %43)
%45 = call i32 (...) @popIndent()
%46 = call i32 @codeln(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Legacy function\00"
@.str.1 = [38 x i8] c"void initPreamp (void *pa, void *m) {\00"
@.str.2 = [46 x i8] c"struct b_preamp *pp = (struct b_preamp *) pa;\00"
@.str.3 = [39 x i8] c"mixFilterWeights (pa, ipwdef, aaldef);\00"
@.str.4 = [62 x i8] c"useMIDIControlFunction (m, \22xov.ctl_biased\22, ctl_biased, pa);\00"
@.str.5 = [68 x i8] c"useMIDIControlFunction (m, \22xov.ctl_biased_fb\22, ctl_biased_fb, pa);\00"
@.str.6 = [70 x i8] c"useMIDIControlFunction (m, \22xov.ctl_biased_fb2\22, ctl_biased_fb2, pa);\00"
@.str.7 = [70 x i8] c"useMIDIControlFunction (m, \22xov.ctl_biased_gfb\22, ctl_biased_gfb, pa);\00"
@.str.8 = [68 x i8] c"useMIDIControlFunction (m, \22xov.ctl_sagtobias\22, ctl_sagtoBias, pa);\00"
@.str.9 = [71 x i8] c"useMIDIControlFunction (m, \22overdrive.character\22, ctl_biased_fat, pa);\00"
@.str.10 = [64 x i8] c"useMIDIControlFunction (m, \22overdrive.enable\22, setCleanCC, pa);\00"
@.str.11 = [69 x i8] c"useMIDIControlFunction (m, \22overdrive.inputgain\22, setInputGain, pa);\00"
@.str.12 = [71 x i8] c"useMIDIControlFunction (m, \22overdrive.outputgain\22, setOutputGain, pa);\00"
@.str.13 = [2 x i8] c"}\00"
define void @legacyInit() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @vspace(i32 3)
%4 = tail call i32 @commentln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @codeln(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @pushIndent()
%7 = tail call i32 @codeln(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @codeln(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @codeln(i8* %2)
%10 = call i32 @codeln(i8* %2)
%11 = call i32 @codeln(i8* %2)
%12 = call i32 @codeln(i8* %2)
%13 = call i32 @codeln(i8* %2)
%14 = call i32 @codeln(i8* %2)
%15 = call i32 (...) @ini_biased()
%16 = call i32 @codeln(i8* %2)
%17 = call i32 @codeln(i8* %2)
%18 = call i32 @codeln(i8* %2)
%19 = call i32 (...) @popIndent()
%20 = call i32 @codeln(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
ret void
}