#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 printTIX3(int shift, int i, int java) {
  if (java) {
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", (i + 16) % 36, i % 36);
    tabs(shift);
    printf("S[%2d] = w;\n", i % 36);
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", (i + 8) % 36, i % 36);
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", (i + 1) % 36, (i + 27) % 36);
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", (i + 4) % 36, (i + 30) % 36);
  } else {
    tabs(shift);
    printf("TIX3(q, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d,"
           " S%02d);\n",
           i, (i + 1) % 36, (i + 4) % 36, (i + 8) % 36, (i + 16) % 36,
           (i + 27) % 36, (i + 30) % 36);
  }
}


x86 assembly (clang, -O0):
<printTIX3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     122d <printTIX3+0x10d>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x8(%rbp),%eax
mov    $0x24,%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    $0x24,%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    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x8(%rbp),%eax
mov    $0x24,%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    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x8(%rbp),%eax
add    $0x1b,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x8(%rbp),%eax
add    $0x1e,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12b5 <printTIX3+0x195>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x8(%rbp),%eax
add    $0x8,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%r8d
mov    -0x8(%rbp),%eax
add    $0x10,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%r9d
mov    -0x8(%rbp),%eax
add    $0x1b,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%r10d
mov    -0x8(%rbp),%eax
add    $0x1e,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%eax
mov    -0x10(%rbp),%edx
lea    0xd7a(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTIX3>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%ebp
mov    %esi,%r12d
mov    %edi,%r15d
call   1030 <tabs@plt>
test   %ebp,%ebp
je     12bc <printTIX3+0x19c>
lea    0x10(%r12),%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%r12,%rax,1),%esi
add    $0x10,%esi
movslq %r12d,%rbx
imul   $0x38e38e39,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
mov    %ebx,%ebp
sub    %eax,%ebp
lea    0xe71(%rip),%r14
mov    %r14,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15d,%edi
call   1030 <tabs@plt>
lea    0xe69(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15d,%edi
call   1030 <tabs@plt>
lea    0x8(%rbx),%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%r12,%rax,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(%rbx),%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%r12,%rax,1),%esi
add    $0x1,%esi
lea    0x1b(%rbx),%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%r12,%rax,1),%edx
add    $0x1b,%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15d,%edi
call   1030 <tabs@plt>
lea    0x4(%rbx),%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%r12,%rax,1),%esi
add    $0x4,%esi
add    $0x1e,%ebx
movslq %ebx,%rax
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%r12,%rax,1),%edx
add    $0x1e,%edx
mov    %r14,%rdi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
lea    0x1(%r12),%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%r12,%rax,1),%edx
add    $0x1,%edx
lea    0x4(%r12),%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%r12,%rax,1),%ecx
add    $0x4,%ecx
lea    0x8(%r12),%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x23,%rax
add    %esi,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%r12,%rax,1),%r8d
add    $0x8,%r8d
lea    0x10(%r12),%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x23,%rax
add    %esi,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%r12,%rax,1),%r9d
add    $0x10,%r9d
lea    0x1b(%r12),%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x23,%rax
add    %esi,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%r12,%rax,1),%ebp
add    $0x1b,%ebp
lea    0x1e(%r12),%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x23,%rax
add    %esi,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
lea    (%r12,%rax,1),%ebx
add    $0x1e,%ebx
lea    0xc5f(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
push   %rbx
push   %rbp
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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 = [59 x i8] c"TIX3(q, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d);\0A\00"
define void @printTIX3(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 %49
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 @tabs(i32 %10)
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 16
%14 = srem i32 %13, 36
%15 = load i32, i32* %5
%16 = srem i32 %15, 36
%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, 36
%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, 36
%28 = load i32, i32* %5
%29 = srem i32 %28, 36
%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, 36
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 27
%38 = srem i32 %37, 36
%39 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %35, i32 %38)
%40 = load i32, i32* %4
%41 = call i32 @tabs(i32 %40)
%42 = load i32, i32* %5
%43 = add nsw i32 %42, 4
%44 = srem i32 %43, 36
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 30
%47 = srem i32 %46, 36
%48 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %44, i32 %47)
br label %72
49: ; preds = %3
%50 = load i32, i32* %4
%51 = call i32 @tabs(i32 %50)
%52 = load i32, i32* %5
%53 = load i32, i32* %5
%54 = add nsw i32 %53, 1
%55 = srem i32 %54, 36
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 4
%58 = srem i32 %57, 36
%59 = load i32, i32* %5
%60 = add nsw i32 %59, 8
%61 = srem i32 %60, 36
%62 = load i32, i32* %5
%63 = add nsw i32 %62, 16
%64 = srem i32 %63, 36
%65 = load i32, i32* %5
%66 = add nsw i32 %65, 27
%67 = srem i32 %66, 36
%68 = load i32, i32* %5
%69 = add nsw i32 %68, 30
%70 = srem i32 %69, 36
%71 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i32 %52, i32 %55, i32 %58, i32 %61, i32 %64, i32 %67, i32 %70)
br label %72
72: ; preds = %49, %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 = [59 x i8] c"TIX3(q, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d);\0A\00"
define void @printTIX3(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = tail call i32 @tabs(i32 %0)
br i1 %4, label %29, label %6
6: ; preds = %3
%7 = add nsw i32 %1, 16
%8 = srem i32 %7, 36
%9 = srem i32 %1, 36
%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, 36
%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, 36
%20 = add nsw i32 %1, 27
%21 = srem i32 %20, 36
%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)
%23 = tail call i32 @tabs(i32 %0)
%24 = add nsw i32 %1, 4
%25 = srem i32 %24, 36
%26 = add nsw i32 %1, 30
%27 = srem i32 %26, 36
%28 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %27)
br label %43
29: ; preds = %3
%30 = add nsw i32 %1, 1
%31 = srem i32 %30, 36
%32 = add nsw i32 %1, 4
%33 = srem i32 %32, 36
%34 = add nsw i32 %1, 8
%35 = srem i32 %34, 36
%36 = add nsw i32 %1, 16
%37 = srem i32 %36, 36
%38 = add nsw i32 %1, 27
%39 = srem i32 %38, 36
%40 = add nsw i32 %1, 30
%41 = srem i32 %40, 36
%42 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i32 %1, i32 %31, i32 %33, i32 %35, i32 %37, i32 %39, i32 %41)
br label %43
43: ; preds = %29, %6
ret void
}