#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 /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
char *unparse_wolopts(int wolopts) {
  static char buf[16];
  char *p = buf;
  memset(buf, 0, sizeof(buf));
  if (wolopts) {
    if (wolopts & (1 << 0))
      *p++ = 'p';
    if (wolopts & (1 << 1))
      *p++ = 'u';
    if (wolopts & (1 << 2))
      *p++ = 'm';
    if (wolopts & (1 << 3))
      *p++ = 'b';
    if (wolopts & (1 << 4))
      *p++ = 'a';
    if (wolopts & (1 << 5))
      *p++ = 'g';
    if (wolopts & (1 << 6))
      *p++ = 's';
  } else {
    *p = 'd';
  }
  return buf;
}


x86 assembly (clang, -O0):
<unparse_wolopts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0x2f1e(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0x2f13(%rip),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
cmpl   $0x0,-0x4(%rbp)
je     122f <unparse_wolopts+0x11f>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1164 <unparse_wolopts+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x70,(%rax)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1185 <unparse_wolopts+0x75>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x75,(%rax)
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     11a6 <unparse_wolopts+0x96>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x6d,(%rax)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     11c7 <unparse_wolopts+0xb7>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x62,(%rax)
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     11e8 <unparse_wolopts+0xd8>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x61,(%rax)
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1209 <unparse_wolopts+0xf9>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x67,(%rax)
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     122a <unparse_wolopts+0x11a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x73,(%rax)
jmp    1236 <unparse_wolopts+0x126>
mov    -0x10(%rbp),%rax
movb   $0x64,(%rax)
lea    0x2e03(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unparse_wolopts>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0x2f24(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
test   %ebp,%ebp
je     115b <unparse_wolopts+0x4b>
test   $0x1,%bpl
jne    1164 <unparse_wolopts+0x54>
test   $0x2,%bpl
jne    1178 <unparse_wolopts+0x68>
test   $0x4,%bpl
jne    1185 <unparse_wolopts+0x75>
test   $0x8,%bpl
jne    1192 <unparse_wolopts+0x82>
test   $0x10,%bpl
jne    119f <unparse_wolopts+0x8f>
test   $0x20,%bpl
jne    11ac <unparse_wolopts+0x9c>
test   $0x40,%bpl
jne    11b9 <unparse_wolopts+0xa9>
jmp    11bc <unparse_wolopts+0xac>
movb   $0x64,0x2ede(%rip)
jmp    11bc <unparse_wolopts+0xac>
movb   $0x70,0x2ed5(%rip)
lea    0x2ecf(%rip),%rbx
test   $0x2,%bpl
je     113b <unparse_wolopts+0x2b>
movb   $0x75,(%rbx)
add    $0x1,%rbx
test   $0x4,%bpl
je     1141 <unparse_wolopts+0x31>
movb   $0x6d,(%rbx)
add    $0x1,%rbx
test   $0x8,%bpl
je     1147 <unparse_wolopts+0x37>
movb   $0x62,(%rbx)
add    $0x1,%rbx
test   $0x10,%bpl
je     114d <unparse_wolopts+0x3d>
movb   $0x61,(%rbx)
add    $0x1,%rbx
test   $0x20,%bpl
je     1153 <unparse_wolopts+0x43>
movb   $0x67,(%rbx)
add    $0x1,%rbx
test   $0x40,%bpl
je     11bc <unparse_wolopts+0xac>
movb   $0x73,(%rbx)
lea    0x2e7d(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@unparse_wolopts.buf = internal global [16 x i8] zeroinitializer
define i8* @unparse_wolopts(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @unparse_wolopts.buf, i64 0, i64 0), i8** %3
%4 = call i32 @memset(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @unparse_wolopts.buf, i64 0, i64 0), i32 0, i32 16)
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %57
7: ; preds = %1
%8 = load i32, i32* %2
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
store i8 112, i8* %12
br label %14
14: ; preds = %11, %7
%15 = load i32, i32* %2
%16 = and i32 %15, 2
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
store i8 117, i8* %19
br label %21
21: ; preds = %18, %14
%22 = load i32, i32* %2
%23 = and i32 %22, 4
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
store i8 109, i8* %26
br label %28
28: ; preds = %25, %21
%29 = load i32, i32* %2
%30 = and i32 %29, 8
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %3
store i8 98, i8* %33
br label %35
35: ; preds = %32, %28
%36 = load i32, i32* %2
%37 = and i32 %36, 16
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = load i8*, i8** %3
%41 = getelementptr inbounds i8, i8* %40, i32 1
store i8* %41, i8** %3
store i8 97, i8* %40
br label %42
42: ; preds = %39, %35
%43 = load i32, i32* %2
%44 = and i32 %43, 32
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i8*, i8** %3
%48 = getelementptr inbounds i8, i8* %47, i32 1
store i8* %48, i8** %3
store i8 103, i8* %47
br label %49
49: ; preds = %46, %42
%50 = load i32, i32* %2
%51 = and i32 %50, 64
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = load i8*, i8** %3
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %3
store i8 115, i8* %54
br label %56
56: ; preds = %53, %49
br label %59
57: ; preds = %1
%58 = load i8*, i8** %3
store i8 100, i8* %58
br label %59
59: ; preds = %57, %56
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @unparse_wolopts.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@unparse_wolopts.buf = internal global [16 x i8] zeroinitializer
define i8* @unparse_wolopts(i32 %0) {
%2 = tail call i32 @memset(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @unparse_wolopts.buf, i64 0, i64 0), i32 0, i32 16)
%3 = icmp eq i32 %0, 0
br i1 %3, label %43, label %4
4: ; preds = %1
%5 = and i32 %0, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
store i8 112, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @unparse_wolopts.buf, i64 0, i64 0)
br label %8
8: ; preds = %7, %4
%9 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @unparse_wolopts.buf, i64 0, i64 1), %7 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @unparse_wolopts.buf, i64 0, i64 0), %4 ]
%10 = and i32 %0, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 117, i8* %9
br label %14
14: ; preds = %12, %8
%15 = phi i8* [ %13, %12 ], [ %9, %8 ]
%16 = and i32 %0, 4
%17 = icmp eq i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %14
%19 = getelementptr inbounds i8, i8* %15, i64 1
store i8 109, i8* %15
br label %20
20: ; preds = %18, %14
%21 = phi i8* [ %19, %18 ], [ %15, %14 ]
%22 = and i32 %0, 8
%23 = icmp eq i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %20
%25 = getelementptr inbounds i8, i8* %21, i64 1
store i8 98, i8* %21
br label %26
26: ; preds = %24, %20
%27 = phi i8* [ %25, %24 ], [ %21, %20 ]
%28 = and i32 %0, 16
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %26
%31 = getelementptr inbounds i8, i8* %27, i64 1
store i8 97, i8* %27
br label %32
32: ; preds = %30, %26
%33 = phi i8* [ %31, %30 ], [ %27, %26 ]
%34 = and i32 %0, 32
%35 = icmp eq i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %32
%37 = getelementptr inbounds i8, i8* %33, i64 1
store i8 103, i8* %33
br label %38
38: ; preds = %36, %32
%39 = phi i8* [ %37, %36 ], [ %33, %32 ]
%40 = and i32 %0, 64
%41 = icmp eq i32 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %38
store i8 115, i8* %39
br label %44
43: ; preds = %1
store i8 100, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @unparse_wolopts.buf, i64 0, i64 0)
br label %44
44: ; preds = %38, %42, %43
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @unparse_wolopts.buf, i64 0, i64 0)
}