#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 gen_outputtest(void) {
  int i;
  printf("// Output test program\n");
  printf("#include \"vu.mac\"\n");
  printf(".parm VU 0 stereopeak\n");
  printf(".gpr VUTMP\n");
  printf(".gpr TMP\n");
  printf(".gpr TMP_L\n");
  printf(".gpr TMP_R\n");
  printf(".send TEST_L 0\n");
  printf(".send TEST_R 1\n");
  for (i = 0; i < 64; i += 2) {
    printf(".output O%d_L	%d\n", i, i);
    printf(".output O%d_R	%d\n", i, i + 1);
  }
  for (i = 0; i < 64; i += 2) {
    if (!(i % 16))
      printf(".parm G%x		0		group\n", i);
    printf(".parm OUT%d	0		stereo\n", i);
  }
  printf("ACC3(TMP_L, TEST_L, 0, 0)\n");
  printf("ACC3(TMP_R, TEST_R, 0, 0)\n");
  printf("VU(VU_L, TMP_L)\n");
  printf("VU(VU_R, TMP_R)\n");
  for (i = 0; i < 64; i += 2) {
    printf("MACS(O%d_L, 0, TMP_L, OUT%d_L)\n", i, i);
    printf("MACS(O%d_R, 0, TMP_R, OUT%d_R)\n", i, i);
  }
}


x86 assembly (clang, -O0):
<gen_outputtest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    11e0 <gen_outputtest+0xd0>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
add    $0x1,%edx
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    119d <gen_outputtest+0x8d>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    1235 <gen_outputtest+0x125>
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1216 <gen_outputtest+0x106>
mov    -0x4(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    11e7 <gen_outputtest+0xd7>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    12b4 <gen_outputtest+0x1a4>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1274 <gen_outputtest+0x164>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_outputtest>:
push   %r15
push   %r14
push   %rbx
lea    0xf64(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf75(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf79(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe68(%rip),%r14
lea    0xe73(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x2(%rbx),%eax
cmp    $0x3e,%ebx
mov    %eax,%ebx
jb     11b0 <gen_outputtest+0x90>
mov    $0xfffffffe,%ebx
lea    0xe41(%rip),%r14
lea    0xe4f(%rip),%r15
jmp    1201 <gen_outputtest+0xe1>
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x3e,%ebx
jae    1217 <gen_outputtest+0xf7>
add    $0x2,%ebx
test   $0xe,%bl
jne    11f0 <gen_outputtest+0xd0>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11f0 <gen_outputtest+0xd0>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffe,%ebx
lea    0xdfd(%rip),%r14
lea    0xe16(%rip),%r15
nopw   0x0(%rax,%rax,1)
add    $0x2,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x3e,%ebx
jb     1260 <gen_outputtest+0x140>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"// Output test program\0A\00"
@.str.1 = [19 x i8] c"#include \22vu.mac\22\0A\00"
@.str.2 = [23 x i8] c".parm VU 0 stereopeak\0A\00"
@.str.3 = [12 x i8] c".gpr VUTMP\0A\00"
@.str.4 = [10 x i8] c".gpr TMP\0A\00"
@.str.5 = [12 x i8] c".gpr TMP_L\0A\00"
@.str.6 = [12 x i8] c".gpr TMP_R\0A\00"
@.str.7 = [16 x i8] c".send TEST_L 0\0A\00"
@.str.8 = [16 x i8] c".send TEST_R 1\0A\00"
@.str.9 = [18 x i8] c".output O%d_L\09%d\0A\00"
@.str.10 = [18 x i8] c".output O%d_R\09%d\0A\00"
@.str.11 = [21 x i8] c".parm G%x\09\090\09\09group\0A\00"
@.str.12 = [23 x i8] c".parm OUT%d\090\09\09stereo\0A\00"
@.str.13 = [27 x i8] c"ACC3(TMP_L, TEST_L, 0, 0)\0A\00"
@.str.14 = [27 x i8] c"ACC3(TMP_R, TEST_R, 0, 0)\0A\00"
@.str.15 = [17 x i8] c"VU(VU_L, TMP_L)\0A\00"
@.str.16 = [17 x i8] c"VU(VU_R, TMP_R)\0A\00"
@.str.17 = [32 x i8] c"MACS(O%d_L, 0, TMP_L, OUT%d_L)\0A\00"
@.str.18 = [32 x i8] c"MACS(O%d_R, 0, TMP_R, OUT%d_R)\0A\00"
define void @gen_outputtest() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %1
br label %11
11: ; preds = %22, %0
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, 64
br i1 %13, label %14, label %25
14: ; preds = %11
%15 = load i32, i32* %1
%16 = load i32, i32* %1
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 %15, i32 %16)
%18 = load i32, i32* %1
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %18, i32 %20)
br label %22
22: ; preds = %14
%23 = load i32, i32* %1
%24 = add nsw i32 %23, 2
store i32 %24, i32* %1
br label %11
25: ; preds = %11
store i32 0, i32* %1
br label %26
26: ; preds = %39, %25
%27 = load i32, i32* %1
%28 = icmp slt i32 %27, 64
br i1 %28, label %29, label %42
29: ; preds = %26
%30 = load i32, i32* %1
%31 = srem i32 %30, 16
%32 = icmp ne i32 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %29
%34 = load i32, i32* %1
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %33, %29
%37 = load i32, i32* %1
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %36
%40 = load i32, i32* %1
%41 = add nsw i32 %40, 2
store i32 %41, i32* %1
br label %26
42: ; preds = %26
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0))
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0))
store i32 0, i32* %1
br label %47
47: ; preds = %57, %42
%48 = load i32, i32* %1
%49 = icmp slt i32 %48, 64
br i1 %49, label %50, label %60
50: ; preds = %47
%51 = load i32, i32* %1
%52 = load i32, i32* %1
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i64 0, i64 0), i32 %51, i32 %52)
%54 = load i32, i32* %1
%55 = load i32, i32* %1
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0), i32 %54, i32 %55)
br label %57
57: ; preds = %50
%58 = load i32, i32* %1
%59 = add nsw i32 %58, 2
store i32 %59, i32* %1
br label %47
60: ; preds = %47
ret void
}

LLVM IR (-O2):
@.str.9 = [18 x i8] c".output O%d_L\09%d\0A\00"
@.str.10 = [18 x i8] c".output O%d_R\09%d\0A\00"
@.str.11 = [21 x i8] c".parm G%x\09\090\09\09group\0A\00"
@.str.12 = [23 x i8] c".parm OUT%d\090\09\09stereo\0A\00"
@.str.17 = [32 x i8] c"MACS(O%d_L, 0, TMP_L, OUT%d_L)\0A\00"
@.str.18 = [32 x i8] c"MACS(O%d_R, 0, TMP_R, OUT%d_R)\0A\00"
@str = [23 x i8] c"// Output test program\00"
@str.19 = [18 x i8] c"#include \22vu.mac\22\00"
@str.20 = [22 x i8] c".parm VU 0 stereopeak\00"
@str.21 = [11 x i8] c".gpr VUTMP\00"
@str.22 = [9 x i8] c".gpr TMP\00"
@str.23 = [11 x i8] c".gpr TMP_L\00"
@str.24 = [11 x i8] c".gpr TMP_R\00"
@str.25 = [15 x i8] c".send TEST_L 0\00"
@str.26 = [15 x i8] c".send TEST_R 1\00"
@str.27 = [26 x i8] c"ACC3(TMP_L, TEST_L, 0, 0)\00"
@str.28 = [26 x i8] c"ACC3(TMP_R, TEST_R, 0, 0)\00"
@str.29 = [16 x i8] c"VU(VU_L, TMP_L)\00"
@str.30 = [16 x i8] c"VU(VU_R, TMP_R)\00"
define void @gen_outputtest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.19, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.20, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.21, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.22, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.23, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.24, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.25, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.26, i64 0, i64 0))
br label %10
10: ; preds = %0, %10
%11 = phi i32 [ 0, %0 ], [ %15, %10 ]
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 %11, i32 %11)
%13 = or i32 %11, 1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %11, i32 %13)
%15 = add nuw nsw i32 %11, 2
%16 = icmp ult i32 %11, 62
br i1 %16, label %10, label %17
17: ; preds = %10, %23
%18 = phi i32 [ %25, %23 ], [ 0, %10 ]
%19 = and i32 %18, 14
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i32 %18)
br label %23
23: ; preds = %21, %17
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i32 %18)
%25 = add nuw nsw i32 %18, 2
%26 = icmp ult i32 %18, 62
br i1 %26, label %17, label %27
27: ; preds = %23
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.27, i64 0, i64 0))
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.28, i64 0, i64 0))
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.29, i64 0, i64 0))
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.30, i64 0, i64 0))
br label %32
32: ; preds = %27, %32
%33 = phi i32 [ 0, %27 ], [ %36, %32 ]
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i64 0, i64 0), i32 %33, i32 %33)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0), i32 %33, i32 %33)
%36 = add nuw nsw i32 %33, 2
%37 = icmp ult i32 %33, 62
br i1 %37, label %32, label %38
38: ; preds = %32
ret void
}