#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);
void ShowWhere(int state, int stream, int mix) {
  static int j = -1;
  static int s = -1;
  static int m = -1;
  if (state != j) {
    printf("\n  State %d: ", state);
    s = -1;
    m = -1;
    j = state;
  }
  if (stream != s && stream != -1) {
    printf("\n    Stream %d: ", stream);
    m = -1;
    s = stream;
  }
  if (mix != m && mix != -1) {
    printf("\n      Mix %d: ", mix);
    m = mix;
  }
}


x86 assembly (clang, -O0):
<ShowWhere>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    0x2efe(%rip),%eax
je     115c <ShowWhere+0x4c>
mov    -0x4(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,0x2ee3(%rip)
ff ff ff
movl   $0xffffffff,0x2edd(%rip)
ff ff ff
mov    -0x4(%rbp),%eax
mov    %eax,0x2ecc(%rip)
mov    -0x8(%rbp),%eax
cmp    0x2ec7(%rip),%eax
je     1197 <ShowWhere+0x87>
cmpl   $0xffffffff,-0x8(%rbp)
je     1197 <ShowWhere+0x87>
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,0x2ea2(%rip)
ff ff ff
mov    -0x8(%rbp),%eax
mov    %eax,0x2e95(%rip)
mov    -0xc(%rbp),%eax
cmp    0x2e90(%rip),%eax
je     11c8 <ShowWhere+0xb8>
cmpl   $0xffffffff,-0xc(%rbp)
je     11c8 <ShowWhere+0xb8>
mov    -0xc(%rbp),%esi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,0x2e68(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowWhere>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
cmp    %edi,0x2f09(%rip)
jne    112e <ShowWhere+0x1e>
mov    0x2f05(%rip),%eax
cmp    $0xffffffff,%ebp
jne    1162 <ShowWhere+0x52>
jmp    1191 <ShowWhere+0x81>
mov    %edi,%ebx
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
movl   $0xffffffff,0x2ee4(%rip)
ff ff ff
movl   $0xffffffff,0x2ede(%rip)
ff ff ff
mov    %ebx,0x2ed0(%rip)
mov    $0xffffffff,%eax
cmp    $0xffffffff,%ebp
je     1191 <ShowWhere+0x81>
cmp    %ebp,%eax
je     1191 <ShowWhere+0x81>
lea    0xea1(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
movl   $0xffffffff,0x2eb2(%rip)
ff ff ff
mov    %ebp,0x2ea8(%rip)
mov    $0xffffffff,%eax
cmp    $0xffffffff,%r14d
jne    119d <ShowWhere+0x8d>
jmp    11b8 <ShowWhere+0xa8>
mov    0x2e99(%rip),%eax
cmp    $0xffffffff,%r14d
je     11b8 <ShowWhere+0xa8>
cmp    %r14d,%eax
je     11b8 <ShowWhere+0xa8>
lea    0xe76(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
mov    %r14d,0x2e78(%rip)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@ShowWhere.j = internal global i32 -1
@ShowWhere.s = internal global i32 -1
@ShowWhere.m = internal global i32 -1
@.str = [14 x i8] c"\0A State %d: \00"
@.str.1 = [17 x i8] c"\0A Stream %d: \00"
@.str.2 = [16 x i8] c"\0A Mix %d: \00"
define void @ShowWhere(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* %4
%8 = load i32, i32* @ShowWhere.j
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 -1, i32* @ShowWhere.s
store i32 -1, i32* @ShowWhere.m
%13 = load i32, i32* %4
store i32 %13, i32* @ShowWhere.j
br label %14
14: ; preds = %10, %3
%15 = load i32, i32* %5
%16 = load i32, i32* @ShowWhere.s
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = load i32, i32* %5
%20 = icmp ne i32 %19, -1
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = load i32, i32* %5
%23 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %22)
store i32 -1, i32* @ShowWhere.m
%24 = load i32, i32* %5
store i32 %24, i32* @ShowWhere.s
br label %25
25: ; preds = %21, %18, %14
%26 = load i32, i32* %6
%27 = load i32, i32* @ShowWhere.m
%28 = icmp ne i32 %26, %27
br i1 %28, label %29, label %36
29: ; preds = %25
%30 = load i32, i32* %6
%31 = icmp ne i32 %30, -1
br i1 %31, label %32, label %36
32: ; preds = %29
%33 = load i32, i32* %6
%34 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %6
store i32 %35, i32* @ShowWhere.m
br label %36
36: ; preds = %32, %29, %25
ret void
}

LLVM IR (-O2):
@ShowWhere.j = internal unnamed_addr global i32 -1
@ShowWhere.s = internal unnamed_addr global i32 -1
@ShowWhere.m = internal unnamed_addr global i32 -1
@.str = [14 x i8] c"\0A State %d: \00"
@.str.1 = [17 x i8] c"\0A Stream %d: \00"
@.str.2 = [16 x i8] c"\0A Mix %d: \00"
define void @ShowWhere(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ShowWhere.j
%5 = icmp eq i32 %4, %0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = load i32, i32* @ShowWhere.s
br label %10
8: ; preds = %3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
store i32 -1, i32* @ShowWhere.s
store i32 -1, i32* @ShowWhere.m
store i32 %0, i32* @ShowWhere.j
br label %10
10: ; preds = %6, %8
%11 = phi i32 [ %7, %6 ], [ -1, %8 ]
%12 = icmp ne i32 %11, %1
%13 = icmp ne i32 %1, -1
%14 = and i1 %13, %12
br i1 %14, label %17, label %15
15: ; preds = %10
%16 = load i32, i32* @ShowWhere.m
br label %19
17: ; preds = %10
%18 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1)
store i32 -1, i32* @ShowWhere.m
store i32 %1, i32* @ShowWhere.s
br label %19
19: ; preds = %15, %17
%20 = phi i32 [ %16, %15 ], [ -1, %17 ]
%21 = icmp ne i32 %20, %2
%22 = icmp ne i32 %2, -1
%23 = and i1 %22, %21
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %2)
store i32 %2, i32* @ShowWhere.m
br label %26
26: ; preds = %24, %19
ret void
}