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

/* Variables and functions */
int /*<<< orphan*/ FindRopInfo(unsigned int);
int /*<<< orphan*/ Output(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ PrintRoutineName(int /*<<< orphan*/ *, unsigned int,
                                    int /*<<< orphan*/);
void CreateTable(FILE *Out, unsigned Bpp) {
  unsigned RopCode;
  ;
  Output(Out, "\n");
  Output(Out, "static void (*PrimitivesTable[256])(PBLTINFO) =\n");
  Output(Out, "{\n");
  for (RopCode = 0; RopCode < 256; RopCode++) {
    PrintRoutineName(Out, Bpp, FindRopInfo(RopCode));
    if (RopCode < 255) {
      Output(Out, ",");
    }
    Output(Out, "\n");
  }
  Output(Out, "};\n");
}


x86 assembly (clang, -O0):
<CreateTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeee(%rip),%rsi
call   1040 <Output@plt>
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1040 <Output@plt>
mov    -0x8(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1040 <Output@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x100,-0x10(%rbp)
jae    11e2 <CreateTable+0xb2>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <FindRopInfo@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1050 <PrintRoutineName@plt>
cmpl   $0xff,-0x10(%rbp)
jae    11c4 <CreateTable+0x94>
mov    -0x8(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1040 <Output@plt>
mov    -0x8(%rbp),%rdi
lea    0xe69(%rip),%rsi
call   1040 <Output@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1176 <CreateTable+0x46>
mov    -0x8(%rbp),%rdi
lea    0xe49(%rip),%rsi
call   1040 <Output@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateTable>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r15d
mov    %rdi,%rbx
lea    0xef3(%rip),%r14
mov    %r14,%rsi
call   1040 <Output@plt>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1040 <Output@plt>
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
call   1040 <Output@plt>
xor    %edi,%edi
call   1030 <FindRopInfo@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %eax,%edx
call   1050 <PrintRoutineName@plt>
mov    $0x1,%ebp
lea    0xea9(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <Output@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <Output@plt>
mov    %ebp,%edi
call   1030 <FindRopInfo@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %eax,%edx
call   1050 <PrintRoutineName@plt>
add    $0x1,%ebp
cmp    $0x100,%ebp
jne    1190 <CreateTable+0x60>
lea    0xe6c(%rip),%rsi
mov    %rbx,%rdi
call   1040 <Output@plt>
lea    0xe5b(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <Output@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [49 x i8] c"static void (*PrimitivesTable[256])(PBLTINFO) =\0A\00"
@.str.2 = [3 x i8] c"{\0A\00"
@.str.3 = [2 x i8] c",\00"
@.str.4 = [4 x i8] c"};\0A\00"
define void @CreateTable(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @Output(i32* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %3
%9 = call i32 @Output(i32* %8, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %3
%11 = call i32 @Output(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
br label %12
12: ; preds = %29, %2
%13 = load i32, i32* %5
%14 = icmp ult i32 %13, 256
br i1 %14, label %15, label %32
15: ; preds = %12
%16 = load i32*, i32** %3
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = call i32 @FindRopInfo(i32 %18)
%20 = call i32 @PrintRoutineName(i32* %16, i32 %17, i32 %19)
%21 = load i32, i32* %5
%22 = icmp ult i32 %21, 255
br i1 %22, label %23, label %26
23: ; preds = %15
%24 = load i32*, i32** %3
%25 = call i32 @Output(i32* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %26
26: ; preds = %23, %15
%27 = load i32*, i32** %3
%28 = call i32 @Output(i32* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %29
29: ; preds = %26
%30 = load i32, i32* %5
%31 = add i32 %30, 1
store i32 %31, i32* %5
br label %12
32: ; preds = %12
%33 = load i32*, i32** %3
%34 = call i32 @Output(i32* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [49 x i8] c"static void (*PrimitivesTable[256])(PBLTINFO) =\0A\00"
@.str.2 = [3 x i8] c"{\0A\00"
@.str.3 = [2 x i8] c",\00"
@.str.4 = [4 x i8] c"};\0A\00"
define void @CreateTable(i32* %0, i32 %1) {
%3 = tail call i32 @Output(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @Output(i32* %0, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @Output(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @FindRopInfo(i32 0)
%7 = tail call i32 @PrintRoutineName(i32* %0, i32 %1, i32 %6)
br label %8
8: ; preds = %2, %8
%9 = phi i32 [ 0, %2 ], [ %12, %8 ]
%10 = tail call i32 @Output(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 @Output(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = add nuw nsw i32 %9, 1
%13 = tail call i32 @FindRopInfo(i32 %12)
%14 = tail call i32 @PrintRoutineName(i32* %0, i32 %1, i32 %13)
%15 = icmp eq i32 %12, 255
br i1 %15, label %16, label %8
16: ; preds = %8
%17 = tail call i32 @Output(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = tail call i32 @Output(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
ret void
}