#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 */
typedef int u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, char *);
int /*<<< orphan*/ strcpy(char *, char *);
const char *vj2asc(u_int32_t val) {
  static char asc[50];
  if (val)
    snprintf(asc, sizeof asc, "%d VJ slots with%s slot compression",
             (int)((val >> 8) & 15) + 1, val & 1 ? "" : "out");
  else
    strcpy(asc, "VJ disabled");
  return asc;
}


x86 assembly (clang, -O0):
<vj2asc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1179 <vj2asc+0x59>
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xf,%ecx
add    $0x1,%ecx
mov    -0x4(%rbp),%edx
and    $0x1,%edx
lea    0xed6(%rip),%r8
lea    0xede(%rip),%rax
cmp    $0x0,%edx
cmovne %rax,%r8
lea    0x2edd(%rip),%rdi
mov    $0x32,%esi
lea    0xe91(%rip),%rdx
call   1040 <snprintf@plt>
jmp    118c <vj2asc+0x6c>
lea    0x2ec0(%rip),%rdi
lea    0xea1(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2ead(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vj2asc>:
push   %rax
test   %edi,%edi
je     1160 <vj2asc+0x40>
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0xf,%ecx
add    $0x1,%ecx
test   $0x1,%dil
lea    0xee9(%rip),%rax
lea    0xef1(%rip),%r8
cmove  %rax,%r8
lea    0x2ef3(%rip),%rdi
lea    0xeac(%rip),%rdx
mov    $0x32,%esi
call   1040 <snprintf@plt>
jmp    1173 <vj2asc+0x53>
lea    0x2ed9(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2ec6(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@vj2asc.asc = internal global [50 x i8] zeroinitializer
@.str = [36 x i8] c"%d VJ slots with%s slot compression\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [4 x i8] c"out\00"
@.str.3 = [12 x i8] c"VJ disabled\00"
define i8* @vj2asc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %1
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 15
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %2
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%15 = call i32 @snprintf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @vj2asc.asc, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %14)
br label %18
16: ; preds = %1
%17 = call i32 @strcpy(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @vj2asc.asc, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %16, %5
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @vj2asc.asc, i64 0, i64 0)
}

LLVM IR (-O2):
@vj2asc.asc = internal global [50 x i8] zeroinitializer
@.str = [36 x i8] c"%d VJ slots with%s slot compression\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [4 x i8] c"out\00"
@.str.3 = [12 x i8] c"VJ disabled\00"
define i8* @vj2asc(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = lshr i32 %0, 8
%5 = and i32 %4, 15
%6 = add nuw nsw i32 %5, 1
%7 = and i32 %0, 1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%10 = tail call i32 @snprintf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @vj2asc.asc, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %9)
br label %13
11: ; preds = %1
%12 = tail call i32 @strcpy(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @vj2asc.asc, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %13
13: ; preds = %11, %3
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @vj2asc.asc, i64 0, i64 0)
}