#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*/ mudstrlcat(char *, char *, int);
const char *magic_bit_name(int magic_flags) {
  static char buf[512];
  buf[0] = '\0';
  if (magic_flags & (1 << 0))
    mudstrlcat(buf, " returning", 512);
  return (buf[0] != '\0') ? buf + 1 : (char *)"none";
}


x86 assembly (clang, -O0):
<magic_bit_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,0x2f1e(%rip)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1149 <magic_bit_name+0x39>
lea    0x2f08(%rip),%rdi
lea    0xec1(%rip),%rsi
mov    $0x200,%edx
call   1030 <mudstrlcat@plt>
movsbl 0x2ef0(%rip),%edx
lea    0xeb4(%rip),%rax
lea    0x2ee2(%rip),%rcx
add    $0x1,%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magic_bit_name>:
push   %rax
movb   $0x0,0x2f28(%rip)
test   $0x1,%dil
jne    1127 <magic_bit_name+0x17>
lea    0xee6(%rip),%rax
pop    %rcx
ret
lea    0x2f12(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    $0x200,%edx
call   1030 <mudstrlcat@plt>
cmpb   $0x0,0x2efa(%rip)
lea    0xebe(%rip),%rcx
lea    0x2eed(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@magic_bit_name.buf = internal global [512 x i8] zeroinitializer
@.str = [11 x i8] c" returning\00"
@.str.1 = [5 x i8] c"none\00"
define i8* @magic_bit_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store i8 0, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @magic_bit_name.buf, i64 0, i64 0)
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @mudstrlcat(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @magic_bit_name.buf, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 512)
br label %8
8: ; preds = %6, %1
%9 = load i8, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @magic_bit_name.buf, i64 0, i64 0)
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @magic_bit_name.buf, i64 0, i64 1), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
ret i8* %13
}

LLVM IR (-O2):
@magic_bit_name.buf = internal global [512 x i8] zeroinitializer
@.str = [11 x i8] c" returning\00"
@.str.1 = [5 x i8] c"none\00"
define i8* @magic_bit_name(i32 %0) {
store i8 0, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @magic_bit_name.buf, i64 0, i64 0)
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @mudstrlcat(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @magic_bit_name.buf, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 512)
%6 = load i8, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @magic_bit_name.buf, i64 0, i64 0)
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([512 x i8], [512 x i8]* @magic_bit_name.buf, i64 0, i64 1)
br label %9
9: ; preds = %4, %1
%10 = phi i8* [ %8, %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %1 ]
ret i8* %10
}