#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_inputtest(void) {
  int i;
  printf("// Input test program\n");
  printf("#include \"vu.mac\"\n");
  printf(".gpr VUTMP\n");
  printf(".gpr TMP\n");
  for (i = 0; i < 64; i += 2) {
    printf(".input I%d_L	%d\n", i, i);
    printf(".input I%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 IVU%d	0		stereopeak\n", i);
  }
  for (i = 0; i < 64; i += 2) {
    printf("ACC3(TMP, I%d_L, 0, 0)\n", i);
    printf("VU(IVU%d_L, TMP)\n", i);
    printf("ACC3(TMP, I%d_R, 0, 0)\n", i);
    printf("VU(IVU%d_R, TMP)\n", i);
  }
}


x86 assembly (clang, -O0):
<gen_inputtest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    119a <gen_inputtest+0x8a>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
add    $0x1,%edx
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <gen_inputtest+0x47>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    11ef <gen_inputtest+0xdf>
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11d0 <gen_inputtest+0xc0>
mov    -0x4(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    11a1 <gen_inputtest+0x91>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    1252 <gen_inputtest+0x142>
mov    -0x4(%rbp),%esi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    11f6 <gen_inputtest+0xe6>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_inputtest>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
lea    0xf76(%rip),%rdi
call   1030 <puts@plt>
lea    0xf80(%rip),%rdi
call   1030 <puts@plt>
lea    0xf86(%rip),%rdi
call   1030 <puts@plt>
lea    0xf85(%rip),%rdi
call   1030 <puts@plt>
lea    0xea0(%rip),%r14
lea    0xeaa(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
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     1170 <gen_inputtest+0x50>
mov    $0xfffffffe,%ebx
lea    0xe7f(%rip),%r14
lea    0xe8d(%rip),%r15
jmp    11c1 <gen_inputtest+0xa1>
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x3e,%ebx
jae    11d7 <gen_inputtest+0xb7>
add    $0x2,%ebx
test   $0xe,%bl
jne    11b0 <gen_inputtest+0x90>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11b0 <gen_inputtest+0x90>
mov    $0xfffffffe,%ebx
lea    0xe6f(%rip),%r14
lea    0xe80(%rip),%r15
lea    0xe8b(%rip),%r12
lea    0xe9c(%rip),%r13
nopl   0x0(%rax,%rax,1)
add    $0x2,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x3e,%ebx
jb     1200 <gen_inputtest+0xe0>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"// Input test program\0A\00"
@.str.1 = [19 x i8] c"#include \22vu.mac\22\0A\00"
@.str.2 = [12 x i8] c".gpr VUTMP\0A\00"
@.str.3 = [10 x i8] c".gpr TMP\0A\00"
@.str.4 = [17 x i8] c".input I%d_L\09%d\0A\00"
@.str.5 = [17 x i8] c".input I%d_R\09%d\0A\00"
@.str.6 = [21 x i8] c".parm G%x\09\090\09\09group\0A\00"
@.str.7 = [27 x i8] c".parm IVU%d\090\09\09stereopeak\0A\00"
@.str.8 = [24 x i8] c"ACC3(TMP, I%d_L, 0, 0)\0A\00"
@.str.9 = [18 x i8] c"VU(IVU%d_L, TMP)\0A\00"
@.str.10 = [24 x i8] c"ACC3(TMP, I%d_R, 0, 0)\0A\00"
@.str.11 = [18 x i8] c"VU(IVU%d_R, TMP)\0A\00"
define void @gen_inputtest() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 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 ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %6
6: ; preds = %17, %0
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 64
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %1
%11 = load i32, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* %1
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %13, i32 %15)
br label %17
17: ; preds = %9
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 2
store i32 %19, i32* %1
br label %6
20: ; preds = %6
store i32 0, i32* %1
br label %21
21: ; preds = %34, %20
%22 = load i32, i32* %1
%23 = icmp slt i32 %22, 64
br i1 %23, label %24, label %37
24: ; preds = %21
%25 = load i32, i32* %1
%26 = srem i32 %25, 16
%27 = icmp ne i32 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %24
%29 = load i32, i32* %1
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %24
%32 = load i32, i32* %1
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %31
%35 = load i32, i32* %1
%36 = add nsw i32 %35, 2
store i32 %36, i32* %1
br label %21
37: ; preds = %21
store i32 0, i32* %1
br label %38
38: ; preds = %50, %37
%39 = load i32, i32* %1
%40 = icmp slt i32 %39, 64
br i1 %40, label %41, label %53
41: ; preds = %38
%42 = load i32, i32* %1
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %42)
%44 = load i32, i32* %1
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 %44)
%46 = load i32, i32* %1
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i32 %46)
%48 = load i32, i32* %1
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %41
%51 = load i32, i32* %1
%52 = add nsw i32 %51, 2
store i32 %52, i32* %1
br label %38
53: ; preds = %38
ret void
}

LLVM IR (-O2):
@.str.4 = [17 x i8] c".input I%d_L\09%d\0A\00"
@.str.5 = [17 x i8] c".input I%d_R\09%d\0A\00"
@.str.6 = [21 x i8] c".parm G%x\09\090\09\09group\0A\00"
@.str.7 = [27 x i8] c".parm IVU%d\090\09\09stereopeak\0A\00"
@.str.8 = [24 x i8] c"ACC3(TMP, I%d_L, 0, 0)\0A\00"
@.str.9 = [18 x i8] c"VU(IVU%d_L, TMP)\0A\00"
@.str.10 = [24 x i8] c"ACC3(TMP, I%d_R, 0, 0)\0A\00"
@.str.11 = [18 x i8] c"VU(IVU%d_R, TMP)\0A\00"
@str = [22 x i8] c"// Input test program\00"
@str.12 = [18 x i8] c"#include \22vu.mac\22\00"
@str.13 = [11 x i8] c".gpr VUTMP\00"
@str.14 = [9 x i8] c".gpr TMP\00"
define void @gen_inputtest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.12, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.13, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.14, i64 0, i64 0))
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ 0, %0 ], [ %10, %5 ]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %6, i32 %6)
%8 = or i32 %6, 1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %6, i32 %8)
%10 = add nuw nsw i32 %6, 2
%11 = icmp ult i32 %6, 62
br i1 %11, label %5, label %12
12: ; preds = %5, %18
%13 = phi i32 [ %20, %18 ], [ 0, %5 ]
%14 = and i32 %13, 14
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %13)
br label %18
18: ; preds = %16, %12
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 %13)
%20 = add nuw nsw i32 %13, 2
%21 = icmp ult i32 %13, 62
br i1 %21, label %12, label %22
22: ; preds = %18, %22
%23 = phi i32 [ %28, %22 ], [ 0, %18 ]
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %23)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 %23)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i32 %23)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %23)
%28 = add nuw nsw i32 %23, 2
%29 = icmp ult i32 %23, 62
br i1 %29, label %22, label %30
30: ; preds = %22
ret void
}