#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 /*<<< orphan*/ tabs(int);
void printNEXT(int shift, int cc, int java) {
  if (java) {
    tabs(shift);
    printf("if (num -- <= 0) {\n");
    tabs(shift + 1);
    printf("rshift = %d;\n", cc);
    tabs(shift + 1);
    printf("return;\n");
    tabs(shift);
    printf("}\n");
    tabs(shift);
    printf("w = (buf[off] << 24)\n");
    tabs(shift + 1);
    printf("| ((buf[off + 1] & 0xFF) << 16)\n");
    tabs(shift + 1);
    printf("| ((buf[off + 2] & 0xFF) << 8)\n");
    tabs(shift + 1);
    printf("| (buf[off + 3] & 0xFF);\n");
    tabs(shift);
    printf("off += 4;\n");
  } else {
    tabs(shift);
    printf("NEXT(%d);\n", cc);
  }
}


x86 assembly (clang, -O0):
<printNEXT>:
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     1218 <printNEXT+0xf8>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <tabs@plt>
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <tabs@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <tabs@plt>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <tabs@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <tabs@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1231 <printNEXT+0x111>
mov    -0x4(%rbp),%edi
call   1030 <tabs@plt>
mov    -0x8(%rbp),%esi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printNEXT>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %edi,%ebx
call   1040 <tabs@plt>
test   %ebp,%ebp
je     11f8 <printNEXT+0xc8>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0x1(%rbx),%ebp
mov    %ebp,%edi
call   1040 <tabs@plt>
lea    0xe9b(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%edi
call   1040 <tabs@plt>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <tabs@plt>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <tabs@plt>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
call   1040 <tabs@plt>
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
call   1040 <tabs@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
call   1040 <tabs@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <tabs@plt>
lea    0xeb4(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>
lea    0xe0f(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"if (num -- <= 0) {\0A\00"
@.str.1 = [14 x i8] c"rshift = %d;\0A\00"
@.str.2 = [9 x i8] c"return;\0A\00"
@.str.3 = [3 x i8] c"}\0A\00"
@.str.4 = [22 x i8] c"w = (buf[off] << 24)\0A\00"
@.str.5 = [33 x i8] c"| ((buf[off + 1] & 0xFF) << 16)\0A\00"
@.str.6 = [32 x i8] c"| ((buf[off + 2] & 0xFF) << 8)\0A\00"
@.str.7 = [26 x i8] c"| (buf[off + 3] & 0xFF);\0A\00"
@.str.8 = [11 x i8] c"off += 4;\0A\00"
@.str.9 = [11 x i8] c"NEXT(%d);\0A\00"
define void @printNEXT(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 %43
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 @tabs(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = call i32 @tabs(i32 %14)
%16 = load i32, i32* %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
%20 = call i32 @tabs(i32 %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* %4
%23 = call i32 @tabs(i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%25 = load i32, i32* %4
%26 = call i32 @tabs(i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
%30 = call i32 @tabs(i32 %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
%34 = call i32 @tabs(i32 %33)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
%38 = call i32 @tabs(i32 %37)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%40 = load i32, i32* %4
%41 = call i32 @tabs(i32 %40)
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %48
43: ; preds = %3
%44 = load i32, i32* %4
%45 = call i32 @tabs(i32 %44)
%46 = load i32, i32* %5
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %43, %9
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"rshift = %d;\0A\00"
@.str.9 = [11 x i8] c"NEXT(%d);\0A\00"
@str = [19 x i8] c"if (num -- <= 0) {\00"
@str.10 = [8 x i8] c"return;\00"
@str.11 = [2 x i8] c"}\00"
@str.12 = [21 x i8] c"w = (buf[off] << 24)\00"
@str.13 = [32 x i8] c"| ((buf[off + 1] & 0xFF) << 16)\00"
@str.14 = [31 x i8] c"| ((buf[off + 2] & 0xFF) << 8)\00"
@str.15 = [25 x i8] c"| (buf[off + 3] & 0xFF);\00"
@str.16 = [10 x i8] c"off += 4;\00"
define void @printNEXT(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = tail call i32 @tabs(i32 %0)
br i1 %4, label %25, label %6
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%8 = add nsw i32 %0, 1
%9 = tail call i32 @tabs(i32 %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%11 = tail call i32 @tabs(i32 %8)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.10, i64 0, i64 0))
%13 = tail call i32 @tabs(i32 %0)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.11, i64 0, i64 0))
%15 = tail call i32 @tabs(i32 %0)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.12, i64 0, i64 0))
%17 = tail call i32 @tabs(i32 %8)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.13, i64 0, i64 0))
%19 = tail call i32 @tabs(i32 %8)
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.14, i64 0, i64 0))
%21 = tail call i32 @tabs(i32 %8)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.15, i64 0, i64 0))
%23 = tail call i32 @tabs(i32 %0)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.16, i64 0, i64 0))
br label %27
25: ; preds = %3
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %1)
br label %27
27: ; preds = %25, %6
ret void
}