#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, ...);
int /*<<< orphan*/ tabs(int);
void printCMIX36(int shift, int i, int java) {
  if (java) {
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", i % 36, (i + 4) % 36);
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", (i + 1) % 36, (i + 5) % 36);
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", (i + 2) % 36, (i + 6) % 36);
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", (i + 18) % 36, (i + 4) % 36);
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", (i + 19) % 36, (i + 5) % 36);
    tabs(shift);
    printf("S[%2d] ^= S[%2d];\n", (i + 20) % 36, (i + 6) % 36);
  } else {
    tabs(shift);
    printf("CMIX36(S%02d, S%02d, S%02d, S%02d, S%02d, S%02d,"
           " S%02d, S%02d, S%02d);\n",
           i, (i + 1) % 36, (i + 2) % 36, (i + 4) % 36, (i + 5) % 36,
           (i + 6) % 36, (i + 18) % 36, (i + 19) % 36, (i + 20) % 36);
  }
}


x86 assembly (clang, -O0):
<printCMIX36>:
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     1276 <printCMIX36+0x156>
mov    -0xc(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x10(%rbp),%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%eax
add    $0x4,%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
add    $0x1,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%eax
add    $0x5,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%eax
add    $0x6,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x10(%rbp),%eax
add    $0x12,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x10(%rbp),%eax
add    $0x13,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%eax
add    $0x5,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x10(%rbp),%eax
add    $0x14,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x10(%rbp),%eax
add    $0x6,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1328 <printCMIX36+0x208>
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    $0x2,%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%r8d
mov    -0x10(%rbp),%eax
add    $0x5,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%r9d
mov    -0x10(%rbp),%eax
add    $0x6,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%ebx
mov    -0x10(%rbp),%eax
add    $0x12,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%r11d
mov    -0x10(%rbp),%eax
add    $0x13,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%r10d
mov    -0x10(%rbp),%eax
add    $0x14,%eax
mov    $0x24,%edi
cltd
idiv   %edi
mov    %edx,%eax
mov    -0x18(%rbp),%edx
lea    0xd03(%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):
<printCMIX36>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%ebx
mov    %edi,%r13d
call   1030 <tabs@plt>
test   %ebp,%ebp
je     1327 <printCMIX36+0x207>
movslq %ebx,%rbp
imul   $0x38e38e39,%rbp,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,8),%eax
mov    %ebp,%esi
sub    %eax,%esi
lea    0x4(%rbp),%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    (%rax,%rbp,1),%r15d
add    $0x4,%r15d
lea    0xe70(%rip),%r14
mov    %r14,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13d,%edi
call   1030 <tabs@plt>
lea    0x1(%rbp),%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    (%rax,%rbp,1),%esi
add    $0x1,%esi
lea    0x5(%rbp),%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    (%rax,%rbp,1),%r12d
add    $0x5,%r12d
mov    %r14,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13d,%edi
call   1030 <tabs@plt>
lea    0x2(%rbp),%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    (%rax,%rbp,1),%esi
add    $0x2,%esi
lea    0x6(%rbp),%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    (%rax,%rbp,1),%ebx
add    $0x6,%ebx
mov    %r14,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13d,%edi
call   1030 <tabs@plt>
lea    0x12(%rbp),%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    (%rax,%rbp,1),%esi
add    $0x12,%esi
mov    %r14,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13d,%edi
call   1030 <tabs@plt>
lea    0x13(%rbp),%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    (%rax,%rbp,1),%esi
add    $0x13,%esi
mov    %r14,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13d,%edi
call   1030 <tabs@plt>
mov    %ebp,%eax
add    $0x14,%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    (%rax,%rbp,1),%esi
add    $0x14,%esi
mov    %r14,%rdi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@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    (%rbx,%rax,1),%edx
add    $0x1,%edx
lea    0x2(%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    (%rbx,%rax,1),%ecx
add    $0x2,%ecx
lea    0x4(%rbx),%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    (%rbx,%rax,1),%r8d
add    $0x4,%r8d
lea    0x5(%rbx),%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    (%rbx,%rax,1),%r9d
add    $0x5,%r9d
lea    0x6(%rbx),%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    (%rbx,%rax,1),%r10d
add    $0x6,%r10d
lea    0x12(%rbx),%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    (%rbx,%rax,1),%r11d
add    $0x12,%r11d
lea    0x13(%rbx),%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    (%rbx,%rax,1),%r14d
add    $0x13,%r14d
lea    0x14(%rbx),%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    (%rbx,%rax,1),%ebp
add    $0x14,%ebp
lea    0xba3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
push   %rbp
push   %r14
push   %r11
push   %r10
call   1040 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"S[%2d] ^= S[%2d];\0A\00"
@.str.1 = [72 x i8] c"CMIX36(S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d);\0A\00"
define void @printCMIX36(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 %63
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 @tabs(i32 %10)
%12 = load i32, i32* %5
%13 = srem i32 %12, 36
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 4
%16 = srem i32 %15, 36
%17 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %16)
%18 = load i32, i32* %4
%19 = call i32 @tabs(i32 %18)
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
%22 = srem i32 %21, 36
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 5
%25 = srem i32 %24, 36
%26 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %25)
%27 = load i32, i32* %4
%28 = call i32 @tabs(i32 %27)
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 2
%31 = srem i32 %30, 36
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 6
%34 = srem i32 %33, 36
%35 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %31, i32 %34)
%36 = load i32, i32* %4
%37 = call i32 @tabs(i32 %36)
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 18
%40 = srem i32 %39, 36
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 4
%43 = srem i32 %42, 36
%44 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %40, i32 %43)
%45 = load i32, i32* %4
%46 = call i32 @tabs(i32 %45)
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 19
%49 = srem i32 %48, 36
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 5
%52 = srem i32 %51, 36
%53 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %49, i32 %52)
%54 = load i32, i32* %4
%55 = call i32 @tabs(i32 %54)
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 20
%58 = srem i32 %57, 36
%59 = load i32, i32* %5
%60 = add nsw i32 %59, 6
%61 = srem i32 %60, 36
%62 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %58, i32 %61)
br label %92
63: ; preds = %3
%64 = load i32, i32* %4
%65 = call i32 @tabs(i32 %64)
%66 = load i32, i32* %5
%67 = load i32, i32* %5
%68 = add nsw i32 %67, 1
%69 = srem i32 %68, 36
%70 = load i32, i32* %5
%71 = add nsw i32 %70, 2
%72 = srem i32 %71, 36
%73 = load i32, i32* %5
%74 = add nsw i32 %73, 4
%75 = srem i32 %74, 36
%76 = load i32, i32* %5
%77 = add nsw i32 %76, 5
%78 = srem i32 %77, 36
%79 = load i32, i32* %5
%80 = add nsw i32 %79, 6
%81 = srem i32 %80, 36
%82 = load i32, i32* %5
%83 = add nsw i32 %82, 18
%84 = srem i32 %83, 36
%85 = load i32, i32* %5
%86 = add nsw i32 %85, 19
%87 = srem i32 %86, 36
%88 = load i32, i32* %5
%89 = add nsw i32 %88, 20
%90 = srem i32 %89, 36
%91 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.1, i64 0, i64 0), i32 %66, i32 %69, i32 %72, i32 %75, i32 %78, i32 %81, i32 %84, i32 %87, i32 %90)
br label %92
92: ; preds = %63, %9
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"S[%2d] ^= S[%2d];\0A\00"
@.str.1 = [72 x i8] c"CMIX36(S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d, S%02d);\0A\00"
define void @printCMIX36(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 = srem i32 %1, 36
%8 = add nsw i32 %1, 4
%9 = srem i32 %8, 36
%10 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%11 = tail call i32 @tabs(i32 %0)
%12 = add nsw i32 %1, 1
%13 = srem i32 %12, 36
%14 = add nsw i32 %1, 5
%15 = srem i32 %14, 36
%16 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %15)
%17 = tail call i32 @tabs(i32 %0)
%18 = add nsw i32 %1, 2
%19 = srem i32 %18, 36
%20 = add nsw i32 %1, 6
%21 = srem i32 %20, 36
%22 = tail call i32 (i8*, i32, 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, 18
%25 = srem i32 %24, 36
%26 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %9)
%27 = tail call i32 @tabs(i32 %0)
%28 = add nsw i32 %1, 19
%29 = srem i32 %28, 36
%30 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %29, i32 %15)
%31 = tail call i32 @tabs(i32 %0)
%32 = add nsw i32 %1, 20
%33 = srem i32 %32, 36
%34 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %33, i32 %21)
br label %53
35: ; preds = %3
%36 = add nsw i32 %1, 1
%37 = srem i32 %36, 36
%38 = add nsw i32 %1, 2
%39 = srem i32 %38, 36
%40 = add nsw i32 %1, 4
%41 = srem i32 %40, 36
%42 = add nsw i32 %1, 5
%43 = srem i32 %42, 36
%44 = add nsw i32 %1, 6
%45 = srem i32 %44, 36
%46 = add nsw i32 %1, 18
%47 = srem i32 %46, 36
%48 = add nsw i32 %1, 19
%49 = srem i32 %48, 36
%50 = add nsw i32 %1, 20
%51 = srem i32 %50, 36
%52 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.1, 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
}