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


x86 assembly (clang, -O0):
<printTIX4>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x38,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1262 <printTIX4+0x142>
mov    -0xc(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x10(%rbp),%eax
add    $0x16,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x10(%rbp),%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x10(%rbp),%eax
add    $0x8,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%eax
add    $0x18,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%eax
add    $0x1b,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x10(%rbp),%eax
add    $0x7,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%eax
add    $0x1e,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1314 <printTIX4+0x1f4>
mov    -0xc(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x10(%rbp),%eax
add    $0x7,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%r8d
mov    -0x10(%rbp),%eax
add    $0x8,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%r9d
mov    -0x10(%rbp),%eax
add    $0x16,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%ebx
mov    -0x10(%rbp),%eax
add    $0x18,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%r11d
mov    -0x10(%rbp),%eax
add    $0x1b,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%r10d
mov    -0x10(%rbp),%eax
add    $0x1e,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%eax
mov    -0x18(%rbp),%edx
lea    0xd24(%rip),%rdi
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTIX4>:
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     131e <printTIX4+0x1fe>
lea    0x16(%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    $0x16,%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    0x18(%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    $0x18,%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
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    0x7(%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    $0x7,%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    0x7(%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    $0x7,%r8d
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),%r9d
add    $0x8,%r9d
lea    0x16(%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),%r10d
add    $0x16,%r10d
lea    0x18(%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),%r11d
add    $0x18,%r11d
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    0xba7(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
push   %rbx
push   %rbp
push   %r11
push   %r10
call   1040 <printf@plt>
add    $0x20,%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 = [73 x i8] c"TIX4(q, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d);\0A\00"
define void @printTIX4(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 %58
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 @tabs(i32 %10)
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 22
%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, 24
%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, 27
%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)
%49 = load i32, i32* %4
%50 = call i32 @tabs(i32 %49)
%51 = load i32, i32* %5
%52 = add nsw i32 %51, 7
%53 = srem i32 %52, 36
%54 = load i32, i32* %5
%55 = add nsw i32 %54, 30
%56 = srem i32 %55, 36
%57 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %53, i32 %56)
br label %87
58: ; preds = %3
%59 = load i32, i32* %4
%60 = call i32 @tabs(i32 %59)
%61 = load i32, i32* %5
%62 = load i32, i32* %5
%63 = add nsw i32 %62, 1
%64 = srem i32 %63, 36
%65 = load i32, i32* %5
%66 = add nsw i32 %65, 4
%67 = srem i32 %66, 36
%68 = load i32, i32* %5
%69 = add nsw i32 %68, 7
%70 = srem i32 %69, 36
%71 = load i32, i32* %5
%72 = add nsw i32 %71, 8
%73 = srem i32 %72, 36
%74 = load i32, i32* %5
%75 = add nsw i32 %74, 22
%76 = srem i32 %75, 36
%77 = load i32, i32* %5
%78 = add nsw i32 %77, 24
%79 = srem i32 %78, 36
%80 = load i32, i32* %5
%81 = add nsw i32 %80, 27
%82 = srem i32 %81, 36
%83 = load i32, i32* %5
%84 = add nsw i32 %83, 30
%85 = srem i32 %84, 36
%86 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0), i32 %61, i32 %64, i32 %67, i32 %70, i32 %73, i32 %76, i32 %79, i32 %82, i32 %85)
br label %87
87: ; preds = %58, %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 = [73 x i8] c"TIX4(q, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d);\0A\00"
define void @printTIX4(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = tail call i32 @tabs(i32 %0)
br i1 %4, label %35, label %6
6: ; preds = %3
%7 = add nsw i32 %1, 22
%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, 24
%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, 27
%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)
%29 = tail call i32 @tabs(i32 %0)
%30 = add nsw i32 %1, 7
%31 = srem i32 %30, 36
%32 = add nsw i32 %1, 30
%33 = srem i32 %32, 36
%34 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %31, i32 %33)
br label %53
35: ; preds = %3
%36 = add nsw i32 %1, 1
%37 = srem i32 %36, 36
%38 = add nsw i32 %1, 4
%39 = srem i32 %38, 36
%40 = add nsw i32 %1, 7
%41 = srem i32 %40, 36
%42 = add nsw i32 %1, 8
%43 = srem i32 %42, 36
%44 = add nsw i32 %1, 22
%45 = srem i32 %44, 36
%46 = add nsw i32 %1, 24
%47 = srem i32 %46, 36
%48 = add nsw i32 %1, 27
%49 = srem i32 %48, 36
%50 = add nsw i32 %1, 30
%51 = srem i32 %50, 36
%52 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0), i32 %1, i32 %37, i32 %39, i32 %41, i32 %43, i32 %45, i32 %47, i32 %49, i32 %51)
br label %53
53: ; preds = %35, %6
ret void
}