#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 *);
int strlen(char *);
char *AwZclPowerSourceTxt(unsigned char source) {
  static char buf[128];
  int lg;
  buf[0] = '\0';
  if ((source & 0x01) == 0x01)
    strcat(buf, "const&");
  if ((source & 0x02) == 0x02)
    strcat(buf, "rechar&");
  if ((source & 0x04) == 0x04)
    strcat(buf, "dispos&");
  if ((source & 0x08) == 0x08)
    strcat(buf, "solar&");
  if ((source & 0x10) == 0x10)
    strcat(buf, "tic&");
  lg = strlen(buf);
  if (lg <= 0)
    return buf;
  buf[lg - 1] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<AwZclPowerSourceTxt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movb   $0x0,0x2f0b(%rip)
movzbl -0x9(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1158 <AwZclPowerSourceTxt+0x38>
lea    0x2ef4(%rip),%rdi
lea    0xead(%rip),%rsi
call   1040 <strcat@plt>
movzbl -0x9(%rbp),%eax
and    $0x2,%eax
cmp    $0x2,%eax
jne    117b <AwZclPowerSourceTxt+0x5b>
lea    0x2ed1(%rip),%rdi
lea    0xe91(%rip),%rsi
call   1040 <strcat@plt>
movzbl -0x9(%rbp),%eax
and    $0x4,%eax
cmp    $0x4,%eax
jne    119e <AwZclPowerSourceTxt+0x7e>
lea    0x2eae(%rip),%rdi
lea    0xe76(%rip),%rsi
call   1040 <strcat@plt>
movzbl -0x9(%rbp),%eax
and    $0x8,%eax
cmp    $0x8,%eax
jne    11c1 <AwZclPowerSourceTxt+0xa1>
lea    0x2e8b(%rip),%rdi
lea    0xe5b(%rip),%rsi
call   1040 <strcat@plt>
movzbl -0x9(%rbp),%eax
and    $0x10,%eax
cmp    $0x10,%eax
jne    11e4 <AwZclPowerSourceTxt+0xc4>
lea    0x2e68(%rip),%rdi
lea    0xe3f(%rip),%rsi
call   1040 <strcat@plt>
lea    0x2e55(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jg     120d <AwZclPowerSourceTxt+0xed>
lea    0x2e3c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    122c <AwZclPowerSourceTxt+0x10c>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2e23(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2e18(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AwZclPowerSourceTxt>:
push   %rbx
mov    %edi,%ebx
movb   $0x0,0x2f16(%rip)
test   $0x1,%bl
jne    117d <AwZclPowerSourceTxt+0x5d>
test   $0x2,%bl
jne    1195 <AwZclPowerSourceTxt+0x75>
test   $0x4,%bl
jne    11ad <AwZclPowerSourceTxt+0x8d>
test   $0x8,%bl
jne    11c9 <AwZclPowerSourceTxt+0xa9>
test   $0x10,%bl
je     115a <AwZclPowerSourceTxt+0x3a>
lea    0x2ef2(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcat@plt>
lea    0x2edf(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1174 <AwZclPowerSourceTxt+0x54>
add    $0xffffffff,%eax
movb   $0x0,(%rax,%rbx,1)
lea    0x2ec5(%rip),%rax
pop    %rbx
ret
lea    0x2ebc(%rip),%rdi
lea    0xe75(%rip),%rsi
call   1040 <strcat@plt>
test   $0x2,%bl
je     1134 <AwZclPowerSourceTxt+0x14>
lea    0x2ea4(%rip),%rdi
lea    0xe64(%rip),%rsi
call   1040 <strcat@plt>
test   $0x4,%bl
je     1139 <AwZclPowerSourceTxt+0x19>
lea    0x2e8c(%rip),%rdi
lea    0xe54(%rip),%rsi
call   1040 <strcat@plt>
test   $0x8,%bl
je     1142 <AwZclPowerSourceTxt+0x22>
lea    0x2e70(%rip),%rdi
lea    0xe40(%rip),%rsi
call   1040 <strcat@plt>
test   $0x10,%bl
jne    1147 <AwZclPowerSourceTxt+0x27>
jmp    115a <AwZclPowerSourceTxt+0x3a>

LLVM IR (-O0):
@AwZclPowerSourceTxt.buf = internal global [128 x i8] zeroinitializer
@.str = [7 x i8] c"const&\00"
@.str.1 = [8 x i8] c"rechar&\00"
@.str.2 = [8 x i8] c"dispos&\00"
@.str.3 = [7 x i8] c"solar&\00"
@.str.4 = [5 x i8] c"tic&\00"
define i8* @AwZclPowerSourceTxt(i8 zeroext %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i8 0, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0)
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = and i32 %13, 2
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %11
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = and i32 %20, 4
%22 = icmp eq i32 %21, 4
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %18
%26 = load i8, i8* %3
%27 = zext i8 %26 to i32
%28 = and i32 %27, 8
%29 = icmp eq i32 %28, 8
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %30, %25
%33 = load i8, i8* %3
%34 = zext i8 %33 to i32
%35 = and i32 %34, 16
%36 = icmp eq i32 %35, 16
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %39
39: ; preds = %37, %32
%40 = call i32 @strlen(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0))
store i32 %40, i32* %4
%41 = load i32, i32* %4
%42 = icmp sle i32 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %39
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0), i8** %2
br label %49
44: ; preds = %39
%45 = load i32, i32* %4
%46 = sub nsw i32 %45, 1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 %47
store i8 0, i8* %48
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0), i8** %2
br label %49
49: ; preds = %44, %43
%50 = load i8*, i8** %2
ret i8* %50
}

LLVM IR (-O2):
@AwZclPowerSourceTxt.buf = internal global [128 x i8] zeroinitializer
@.str = [7 x i8] c"const&\00"
@.str.1 = [8 x i8] c"rechar&\00"
@.str.2 = [8 x i8] c"dispos&\00"
@.str.3 = [7 x i8] c"solar&\00"
@.str.4 = [5 x i8] c"tic&\00"
define i8* @AwZclPowerSourceTxt(i8 zeroext %0) {
store i8 0, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0)
%2 = zext i8 %0 to i32
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = and i32 %2, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = and i32 %2, 4
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = and i32 %2, 8
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
%23 = and i32 %2, 16
%24 = icmp eq i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
%28 = tail call i32 @strlen(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0))
%29 = icmp slt i32 %28, 1
br i1 %29, label %34, label %30
30: ; preds = %27
%31 = add nsw i32 %28, -1
%32 = zext i32 %31 to i64
%33 = getelementptr inbounds [128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 %32
store i8 0, i8* %33
br label %34
34: ; preds = %27, %30
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @AwZclPowerSourceTxt.buf, i64 0, i64 0)
}