#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, int);
int /*<<< orphan*/ tabs(int);
void printSMIX(int shift, int i, int s, int java) {
  if (java) {
    tabs(shift);
    printf("smix(%2d, %2d, %2d, %2d);\n", i % s, (i + 1) % s, (i + 2) % s,
           (i + 3) % s);
  } else {
    tabs(shift);
    printf("SMIX(S%02d, S%02d, S%02d, S%02d);\n", i, (i + 1) % s, (i + 2) % s,
           (i + 3) % s);
  }
}


x86 assembly (clang, -O0):
<printSMIX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1189 <printSMIX+0x69>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%ecx
mov    -0x8(%rbp),%eax
add    $0x3,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%r8d
mov    -0x14(%rbp),%edx
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
jmp    11c9 <printSMIX+0xa9>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%ecx
mov    -0x8(%rbp),%eax
add    $0x3,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%r8d
mov    -0x18(%rbp),%edx
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSMIX>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
call   1030 <tabs@plt>
test   %r14d,%r14d
je     1160 <printSMIX+0x40>
mov    %ebx,%eax
cltd
idiv   %ebp
mov    %edx,%esi
lea    0x1(%rbx),%eax
cltd
idiv   %ebp
mov    %edx,%r8d
lea    0x2(%rbx),%eax
cltd
idiv   %ebp
mov    %edx,%ecx
add    $0x3,%ebx
mov    %ebx,%eax
cltd
idiv   %ebp
mov    %edx,%eax
lea    0xea2(%rip),%rdi
jmp    1182 <printSMIX+0x62>
lea    0x1(%rbx),%eax
cltd
idiv   %ebp
mov    %edx,%r8d
lea    0x2(%rbx),%eax
cltd
idiv   %ebp
mov    %edx,%ecx
lea    0x3(%rbx),%eax
cltd
idiv   %ebp
mov    %edx,%eax
lea    0xe9b(%rip),%rdi
mov    %ebx,%esi
mov    %r8d,%edx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

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

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