#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*/ strcat(char *, char *);
char *got_sent2str(char *buf, unsigned int got_sent) {
  buf[0] = '\0';
  if (got_sent & (1 << 1)) {
    strcat(buf, " sentLIN");
  }
  if (got_sent & (1 << 0)) {
    strcat(buf, " sentLUN");
  }
  if (got_sent & (1 << 2)) {
    strcat(buf, " sentCOO");
  }
  if (got_sent & (1 << 3)) {
    strcat(buf, " sentECO");
  }
  if (got_sent & (1 << 4)) {
    strcat(buf, " sentCBD");
  }
  if (got_sent & (1 << 5)) {
    strcat(buf, " sentLFU");
  }
  return buf;
}


x86 assembly (clang, -O0):
<got_sent2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1145 <got_sent2str+0x35>
mov    -0x8(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1030 <strcat@plt>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1164 <got_sent2str+0x54>
mov    -0x8(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <strcat@plt>
mov    -0xc(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1183 <got_sent2str+0x73>
mov    -0x8(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1030 <strcat@plt>
mov    -0xc(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     11a2 <got_sent2str+0x92>
mov    -0x8(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1030 <strcat@plt>
mov    -0xc(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     11c1 <got_sent2str+0xb1>
mov    -0x8(%rbp),%rdi
lea    0xe68(%rip),%rsi
call   1030 <strcat@plt>
mov    -0xc(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     11e0 <got_sent2str+0xd0>
mov    -0x8(%rbp),%rdi
lea    0xe52(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<got_sent2str>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movb   $0x0,(%rdi)
test   $0x2,%bpl
jne    1158 <got_sent2str+0x48>
test   $0x1,%bpl
jne    116d <got_sent2str+0x5d>
test   $0x4,%bpl
jne    1182 <got_sent2str+0x72>
test   $0x8,%bpl
jne    1197 <got_sent2str+0x87>
test   $0x10,%bpl
jne    11ac <got_sent2str+0x9c>
test   $0x20,%bpl
je     114e <got_sent2str+0x3e>
lea    0xee7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xea1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
test   $0x1,%bpl
je     1127 <got_sent2str+0x17>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
test   $0x4,%bpl
je     112d <got_sent2str+0x1d>
lea    0xe89(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
test   $0x8,%bpl
je     1133 <got_sent2str+0x23>
lea    0xe7d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
test   $0x10,%bpl
je     1139 <got_sent2str+0x29>
lea    0xe71(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
test   $0x20,%bpl
jne    113f <got_sent2str+0x2f>
jmp    114e <got_sent2str+0x3e>

LLVM IR (-O0):
@.str = [9 x i8] c" sentLIN\00"
@.str.1 = [9 x i8] c" sentLUN\00"
@.str.2 = [9 x i8] c" sentCOO\00"
@.str.3 = [9 x i8] c" sentECO\00"
@.str.4 = [9 x i8] c" sentCBD\00"
@.str.5 = [9 x i8] c" sentLFU\00"
define i8* @got_sent2str(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
%7 = load i32, i32* %4
%8 = and i32 %7, 2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10, %2
%14 = load i32, i32* %4
%15 = and i32 %14, 1
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i8*, i8** %3
%19 = call i32 @strcat(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %17, %13
%21 = load i32, i32* %4
%22 = and i32 %21, 4
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i8*, i8** %3
%26 = call i32 @strcat(i8* %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %24, %20
%28 = load i32, i32* %4
%29 = and i32 %28, 8
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = load i8*, i8** %3
%33 = call i32 @strcat(i8* %32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %34
34: ; preds = %31, %27
%35 = load i32, i32* %4
%36 = and i32 %35, 16
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i8*, i8** %3
%40 = call i32 @strcat(i8* %39, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %41
41: ; preds = %38, %34
%42 = load i32, i32* %4
%43 = and i32 %42, 32
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = load i8*, i8** %3
%47 = call i32 @strcat(i8* %46, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %48
48: ; preds = %45, %41
%49 = load i8*, i8** %3
ret i8* %49
}

LLVM IR (-O2):
@.str = [9 x i8] c" sentLIN\00"
@.str.1 = [9 x i8] c" sentLUN\00"
@.str.2 = [9 x i8] c" sentCOO\00"
@.str.3 = [9 x i8] c" sentECO\00"
@.str.4 = [9 x i8] c" sentCBD\00"
@.str.5 = [9 x i8] c" sentLFU\00"
define i8* @got_sent2str(i8* returned %0, i32 %1) {
store i8 0, i8* %0
%3 = and i32 %1, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = and i32 %1, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = and i32 %1, 4
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = and i32 %1, 8
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
%23 = and i32 %1, 16
%24 = icmp eq i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
%28 = and i32 %1, 32
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %32
32: ; preds = %30, %27
ret i8* %0
}