#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*/ sprintf(char *, char *);
int strlen(char *);
char *string_AsciiOrBinaryData(unsigned long flags) {
  static int si = 0;
  static char buf[5][80];
  char *bp, *cp;
  cp = bp = buf[si++];
  si %= 5;
  if (flags & 0x00000001L) {
    sprintf(cp, "Binary");
  } else {
    sprintf(cp, "Ascii");
  }
  cp = cp + strlen(cp);
  return bp;
}


x86 assembly (clang, -O0):
<string_AsciiOrBinaryData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f0e(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f03(%rip)
movslq %eax,%rcx
lea    0x2f09(%rip),%rax
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    0x2ee4(%rip),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,0x2ed6(%rip)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1191 <string_AsciiOrBinaryData+0x71>
mov    -0x18(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1040 <sprintf@plt>
jmp    11a1 <string_AsciiOrBinaryData+0x81>
mov    -0x18(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_AsciiOrBinaryData>:
push   %rbx
mov    0x2f29(%rip),%eax
lea    0x1(%rax),%ecx
lea    (%rax,%rax,4),%rax
shl    $0x4,%rax
lea    0x2f27(%rip),%rbx
add    %rax,%rbx
movslq %ecx,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %eax,0x2ef2(%rip)
test   $0x1,%dil
jne    1162 <string_AsciiOrBinaryData+0x52>
movw   $0x69,0x4(%rbx)
movl   $0x69637341,(%rbx)
jmp    116f <string_AsciiOrBinaryData+0x5f>
movl   $0x797261,0x3(%rbx)
movl   $0x616e6942,(%rbx)
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@string_AsciiOrBinaryData.si = internal global i32 0
@string_AsciiOrBinaryData.buf = internal global [5 x [80 x i8]] zeroinitializer
@.str = [7 x i8] c"Binary\00"
@.str.1 = [6 x i8] c"Ascii\00"
define i8* @string_AsciiOrBinaryData(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i8*
store i64 %0, i64* %2
%5 = load i32, i32* @string_AsciiOrBinaryData.si
%6 = add nsw i32 %5, 1
store i32 %6, i32* @string_AsciiOrBinaryData.si
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* @string_AsciiOrBinaryData.buf, i64 0, i64 %7
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
store i8* %9, i8** %3
store i8* %9, i8** %4
%10 = load i32, i32* @string_AsciiOrBinaryData.si
%11 = srem i32 %10, 5
store i32 %11, i32* @string_AsciiOrBinaryData.si
%12 = load i64, i64* %2
%13 = and i64 %12, 1
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i8*, i8** %4
%17 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %21
18: ; preds = %1
%19 = load i8*, i8** %4
%20 = call i32 @sprintf(i8* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %18, %15
%22 = load i8*, i8** %4
%23 = load i8*, i8** %4
%24 = call i32 @strlen(i8* %23)
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %22, i64 %25
store i8* %26, i8** %4
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
@string_AsciiOrBinaryData.si = internal unnamed_addr global i32 0
@string_AsciiOrBinaryData.buf = internal global [5 x [80 x i8]] zeroinitializer
@.str = [7 x i8] c"Binary\00"
@.str.1 = [6 x i8] c"Ascii\00"
define i8* @string_AsciiOrBinaryData(i64 %0) {
%2 = load i32, i32* @string_AsciiOrBinaryData.si
%3 = add nsw i32 %2, 1
%4 = zext i32 %2 to i64
%5 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* @string_AsciiOrBinaryData.buf, i64 0, i64 %4, i64 0
%6 = srem i32 %3, 5
store i32 %6, i32* @string_AsciiOrBinaryData.si
%7 = and i64 %0, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 dereferenceable(7) %5, i8* align 1 dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 7, i1 false)
br label %11
10: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 dereferenceable(6) %5, i8* align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 6, i1 false)
br label %11
11: ; preds = %10, %9
%12 = tail call i32 @strlen(i8* %5)
ret i8* %5
}