#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 *, int, ...);
int /*<<< orphan*/ tabs(int);
void printTIX2(int shift, int i, int java) {
  if (java) {
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", (i + 10) % 30, i % 30);
    tabs(shift);
    printf("S[%2d] = w;\n", i % 30);
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", (i + 8) % 30, i % 30);
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", (i + 1) % 30, (i + 24) % 30);
  } else {
    tabs(shift);
    printf("TIX2(q, S%02d, S%02d, S%02d, S%02d, S%02d);\n", i, (i + 1) % 30,
           (i + 8) % 30, (i + 10) % 30, (i + 24) % 30);
  }
}


x86 assembly (clang, -O0):
<printTIX2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11f9 <printTIX2+0xd9>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x8(%rbp),%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x8(%rbp),%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x8(%rbp),%eax
add    $0x8,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x8(%rbp),%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x8(%rbp),%eax
add    $0x18,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1258 <printTIX2+0x138>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x8,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    $0x1e,%edi
cltd
idiv   %edi
mov    %edx,%r8d
mov    -0x8(%rbp),%eax
add    $0x18,%eax
mov    $0x1e,%edi
cltd
idiv   %edi
mov    %edx,%r9d
mov    -0x10(%rbp),%edx
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTIX2>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%ebp
mov    %esi,%ebx
mov    %edi,%r15d
call   1030 <tabs@plt>
test   %ebp,%ebp
je     1281 <printTIX2+0x161>
lea    0xa(%rbx),%eax
cltq
imul   $0xffffffff88888889,%rax,%rax
shr    $0x20,%rax
add    %ebx,%eax
add    $0xa,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x4,%eax
add    %ecx,%eax
mov    %eax,%ecx
shl    $0x5,%ecx
mov    %eax,%edx
sub    %ecx,%edx
add    %eax,%edx
lea    (%rbx,%rdx,1),%esi
add    $0xa,%esi
movslq %ebx,%r12
imul   $0xffffffff88888889,%r12,%rax
shr    $0x20,%rax
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x4,%eax
add    %ecx,%eax
mov    %eax,%ecx
shl    $0x5,%ecx
mov    %eax,%ebp
sub    %ecx,%ebp
add    %eax,%ebp
add    %ebx,%ebp
lea    0xe66(%rip),%r14
mov    %r14,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15d,%edi
call   1030 <tabs@plt>
lea    0xe5e(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15d,%edi
call   1030 <tabs@plt>
lea    0x8(%r12),%eax
cltq
imul   $0xffffffff88888889,%rax,%rax
shr    $0x20,%rax
add    %ebx,%eax
add    $0x8,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x4,%eax
add    %ecx,%eax
mov    %eax,%ecx
shl    $0x5,%ecx
mov    %eax,%edx
sub    %ecx,%edx
add    %eax,%edx
lea    (%rbx,%rdx,1),%esi
add    $0x8,%esi
mov    %r14,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15d,%edi
call   1030 <tabs@plt>
lea    0x1(%r12),%eax
cltq
imul   $0xffffffff88888889,%rax,%rax
shr    $0x20,%rax
add    %ebx,%eax
add    $0x1,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x4,%eax
add    %ecx,%eax
mov    %eax,%ecx
shl    $0x5,%ecx
mov    %eax,%edx
sub    %ecx,%edx
add    %eax,%edx
lea    (%rbx,%rdx,1),%esi
add    $0x1,%esi
add    $0x18,%r12d
movslq %r12d,%rax
imul   $0xffffffff88888889,%rax,%rax
shr    $0x20,%rax
add    %ebx,%eax
add    $0x18,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x4,%eax
add    %ecx,%eax
mov    %eax,%ecx
shl    $0x5,%ecx
mov    %eax,%edx
sub    %ecx,%edx
add    %eax,%edx
add    %ebx,%edx
add    $0x18,%edx
mov    %r14,%rdi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
lea    0x1(%rbx),%eax
cltq
imul   $0xffffffff88888889,%rax,%rax
shr    $0x20,%rax
add    %ebx,%eax
add    $0x1,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x4,%eax
add    %ecx,%eax
mov    %eax,%ecx
shl    $0x5,%ecx
mov    %eax,%edx
sub    %ecx,%edx
add    %eax,%edx
add    %ebx,%edx
add    $0x1,%edx
lea    0x8(%rbx),%eax
cltq
imul   $0xffffffff88888889,%rax,%rax
shr    $0x20,%rax
add    %ebx,%eax
add    $0x8,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x4,%eax
add    %ecx,%eax
mov    %eax,%ecx
shl    $0x5,%ecx
mov    %eax,%esi
sub    %ecx,%esi
add    %eax,%esi
lea    (%rbx,%rsi,1),%ecx
add    $0x8,%ecx
lea    0xa(%rbx),%eax
cltq
imul   $0xffffffff88888889,%rax,%rax
shr    $0x20,%rax
add    %ebx,%eax
add    $0xa,%eax
mov    %eax,%esi
shr    $0x1f,%esi
sar    $0x4,%eax
add    %esi,%eax
mov    %eax,%esi
shl    $0x5,%esi
mov    %eax,%edi
sub    %esi,%edi
add    %eax,%edi
lea    (%rbx,%rdi,1),%r8d
add    $0xa,%r8d
lea    0x18(%rbx),%eax
cltq
imul   $0xffffffff88888889,%rax,%rax
shr    $0x20,%rax
add    %ebx,%eax
add    $0x18,%eax
mov    %eax,%esi
shr    $0x1f,%esi
sar    $0x4,%eax
add    %esi,%eax
mov    %eax,%esi
shl    $0x5,%esi
mov    %eax,%edi
sub    %esi,%edi
add    %eax,%edi
lea    (%rbx,%rdi,1),%r9d
add    $0x18,%r9d
lea    0xcd5(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"S[%2d] ^= S[%2d];\0A\00"
@.str.1 = [13 x i8] c"S[%2d] = w;\0A\00"
@.str.2 = [45 x i8] c"TIX2(q, S%02d, S%02d, S%02d, S%02d, S%02d);\0A\00"
define void @printTIX2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %40
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 @tabs(i32 %10)
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 10
%14 = srem i32 %13, 30
%15 = load i32, i32* %5
%16 = srem i32 %15, 30
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %16)
%18 = load i32, i32* %4
%19 = call i32 @tabs(i32 %18)
%20 = load i32, i32* %5
%21 = srem i32 %20, 30
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %4
%24 = call i32 @tabs(i32 %23)
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 8
%27 = srem i32 %26, 30
%28 = load i32, i32* %5
%29 = srem i32 %28, 30
%30 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %29)
%31 = load i32, i32* %4
%32 = call i32 @tabs(i32 %31)
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
%35 = srem i32 %34, 30
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 24
%38 = srem i32 %37, 30
%39 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %35, i32 %38)
br label %57
40: ; preds = %3
%41 = load i32, i32* %4
%42 = call i32 @tabs(i32 %41)
%43 = load i32, i32* %5
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
%46 = srem i32 %45, 30
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 8
%49 = srem i32 %48, 30
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 10
%52 = srem i32 %51, 30
%53 = load i32, i32* %5
%54 = add nsw i32 %53, 24
%55 = srem i32 %54, 30
%56 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 %43, i32 %46, i32 %49, i32 %52, i32 %55)
br label %57
57: ; preds = %40, %9
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"S[%2d] ^= S[%2d];\0A\00"
@.str.1 = [13 x i8] c"S[%2d] = w;\0A\00"
@.str.2 = [45 x i8] c"TIX2(q, S%02d, S%02d, S%02d, S%02d, S%02d);\0A\00"
define void @printTIX2(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = tail call i32 @tabs(i32 %0)
br i1 %4, label %23, label %6
6: ; preds = %3
%7 = add nsw i32 %1, 10
%8 = srem i32 %7, 30
%9 = srem i32 %1, 30
%10 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = tail call i32 @tabs(i32 %0)
%12 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%13 = tail call i32 @tabs(i32 %0)
%14 = add nsw i32 %1, 8
%15 = srem i32 %14, 30
%16 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %9)
%17 = tail call i32 @tabs(i32 %0)
%18 = add nsw i32 %1, 1
%19 = srem i32 %18, 30
%20 = add nsw i32 %1, 24
%21 = srem i32 %20, 30
%22 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %21)
br label %33
23: ; preds = %3
%24 = add nsw i32 %1, 1
%25 = srem i32 %24, 30
%26 = add nsw i32 %1, 8
%27 = srem i32 %26, 30
%28 = add nsw i32 %1, 10
%29 = srem i32 %28, 30
%30 = add nsw i32 %1, 24
%31 = srem i32 %30, 30
%32 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 %1, i32 %25, i32 %27, i32 %29, i32 %31)
br label %33
33: ; preds = %23, %6
ret void
}