#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 unsigned int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ emit_text(int /*<<< orphan*/ *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void generate(FILE *f, const char *field) {
  uint32_t i;
  emit_text(f, "static const uint8_t ");
  emit_text(f, field);
  emit_text(f, "[] __attribute__ ((aligned (64)))  = {\n\t");
  for (i = 0U; i < 256U; ++i) {
    fprintf(f, "%uU,", i >= 128U);
    if (i && (!(i & 7))) {
      emit_text(f, "\n\t");
    }
  }
  emit_text(f, "\n\t};\n");
}


x86 assembly (clang, -O0):
<generate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <emit_text@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <emit_text@plt>
mov    -0x8(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1040 <emit_text@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jae    11cc <generate+0xac>
mov    -0x8(%rbp),%rdi
cmpl   $0x80,-0x14(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edx
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     11b9 <generate+0x99>
mov    -0x14(%rbp),%eax
and    $0x7,%eax
cmp    $0x0,%eax
jne    11b9 <generate+0x99>
mov    -0x8(%rbp),%rdi
lea    0xe88(%rip),%rsi
call   1040 <emit_text@plt>
jmp    11be <generate+0x9e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <generate+0x44>
mov    -0x8(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1040 <emit_text@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecc(%rip),%rsi
call   1040 <emit_text@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <emit_text@plt>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1040 <emit_text@plt>
xor    %ebp,%ebp
lea    0xee3(%rip),%r14
lea    0xed9(%rip),%r15
jmp    117b <generate+0x5b>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
cmp    $0x100,%ebp
je     11a6 <generate+0x86>
xor    %edx,%edx
cmp    $0x7f,%ebp
seta   %dl
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fprintf@plt>
test   %ebp,%ebp
je     1170 <generate+0x50>
mov    %ebp,%eax
and    $0x7,%eax
jne    1170 <generate+0x50>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <emit_text@plt>
jmp    1170 <generate+0x50>
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <emit_text@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"static const uint8_t \00"
@.str.1 = [41 x i8] c"[] __attribute__ ((aligned (64))) = {\0A\09\00"
@.str.2 = [5 x i8] c"%uU,\00"
@.str.3 = [3 x i8] c"\0A\09\00"
@.str.4 = [6 x i8] c"\0A\09};\0A\00"
define void @generate(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
%7 = call i32 @emit_text(i32* %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %3
%9 = load i8*, i8** %4
%10 = call i32 @emit_text(i32* %8, i8* %9)
%11 = load i32*, i32** %3
%12 = call i32 @emit_text(i32* %11, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %5
br label %13
13: ; preds = %32, %2
%14 = load i32, i32* %5
%15 = icmp ult i32 %14, 256
br i1 %15, label %16, label %35
16: ; preds = %13
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = icmp uge i32 %18, 128
%20 = zext i1 %19 to i32
%21 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %5
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %31
24: ; preds = %16
%25 = load i32, i32* %5
%26 = and i32 %25, 7
%27 = icmp ne i32 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %24
%29 = load i32*, i32** %3
%30 = call i32 @emit_text(i32* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %31
31: ; preds = %28, %24, %16
br label %32
32: ; preds = %31
%33 = load i32, i32* %5
%34 = add i32 %33, 1
store i32 %34, i32* %5
br label %13
35: ; preds = %13
%36 = load i32*, i32** %3
%37 = call i32 @emit_text(i32* %36, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"static const uint8_t \00"
@.str.1 = [41 x i8] c"[] __attribute__ ((aligned (64))) = {\0A\09\00"
@.str.2 = [5 x i8] c"%uU,\00"
@.str.3 = [3 x i8] c"\0A\09\00"
@.str.4 = [6 x i8] c"\0A\09};\0A\00"
define void @generate(i32* %0, i8* %1) {
%3 = tail call i32 @emit_text(i32* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @emit_text(i32* %0, i8* %1)
%5 = tail call i32 @emit_text(i32* %0, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %2, %17
%7 = phi i32 [ 0, %2 ], [ %18, %17 ]
%8 = icmp ugt i32 %7, 127
%9 = zext i1 %8 to i32
%10 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = icmp ne i32 %7, 0
%12 = and i32 %7, 7
%13 = icmp eq i32 %12, 0
%14 = and i1 %11, %13
br i1 %14, label %15, label %17
15: ; preds = %6
%16 = tail call i32 @emit_text(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %6, %15
%18 = add nuw nsw i32 %7, 1
%19 = icmp eq i32 %18, 256
br i1 %19, label %20, label %6
20: ; preds = %17
%21 = tail call i32 @emit_text(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret void
}