void init_magic_table(char *magic_table[]) {
  int i;
  for (i = 0; i <= 0xff; i++) {
    magic_table[i] = "";
  }
  magic_table['%'] = "%";
  magic_table['('] = "%(";
}


x86 assembly (clang, -O0):
<init_magic_table>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jg     113d <init_magic_table+0x3d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xed6(%rip),%rdx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_magic_table+0xf>
mov    -0x8(%rbp),%rax
lea    0xeb8(%rip),%rcx
mov    %rcx,0x128(%rax)
mov    -0x8(%rbp),%rax
lea    0xea8(%rip),%rcx
mov    %rcx,0x140(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_magic_table>:
xor    %eax,%eax
lea    0xef8(%rip),%rcx
movq   %rcx,%xmm0
pshufd $0x44,%xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movdqu %xmm0,(%rdi,%rax,8)
movdqu %xmm0,0x10(%rdi,%rax,8)
movdqu %xmm0,0x20(%rdi,%rax,8)
movdqu %xmm0,0x30(%rdi,%rax,8)
movdqu %xmm0,0x40(%rdi,%rax,8)
movdqu %xmm0,0x50(%rdi,%rax,8)
movdqu %xmm0,0x60(%rdi,%rax,8)
movdqu %xmm0,0x70(%rdi,%rax,8)
movdqu %xmm0,0x80(%rdi,%rax,8)
movdqu %xmm0,0x90(%rdi,%rax,8)
movdqu %xmm0,0xa0(%rdi,%rax,8)
movdqu %xmm0,0xb0(%rdi,%rax,8)
movdqu %xmm0,0xc0(%rdi,%rax,8)
movdqu %xmm0,0xd0(%rdi,%rax,8)
movdqu %xmm0,0xe0(%rdi,%rax,8)
movdqu %xmm0,0xf0(%rdi,%rax,8)
add    $0x20,%rax
cmp    $0x100,%rax
jne    1120 <init_magic_table+0x20>
lea    0xe52(%rip),%rax
mov    %rax,0x128(%rdi)
lea    0xe46(%rip),%rax
mov    %rax,0x140(%rdi)
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"%\00"
@.str.2 = [3 x i8] c"%(\00"
define void @init_magic_table(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 255
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i8**, i8*** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i8**, i8*** %2
%17 = getelementptr inbounds i8*, i8** %16, i64 37
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %17
%18 = load i8**, i8*** %2
%19 = getelementptr inbounds i8*, i8** %18, i64 40
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %19
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"%\00"
@.str.2 = [3 x i8] c"%(\00"
define void @init_magic_table(i8** nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %43, %2 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = bitcast i8** %4 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %5
%6 = getelementptr inbounds i8*, i8** %4, i64 2
%7 = bitcast i8** %6 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %7
%8 = or i64 %3, 4
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = bitcast i8** %9 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %10
%11 = getelementptr inbounds i8*, i8** %9, i64 2
%12 = bitcast i8** %11 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %12
%13 = or i64 %3, 8
%14 = getelementptr inbounds i8*, i8** %0, i64 %13
%15 = bitcast i8** %14 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %15
%16 = getelementptr inbounds i8*, i8** %14, i64 2
%17 = bitcast i8** %16 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %17
%18 = or i64 %3, 12
%19 = getelementptr inbounds i8*, i8** %0, i64 %18
%20 = bitcast i8** %19 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %20
%21 = getelementptr inbounds i8*, i8** %19, i64 2
%22 = bitcast i8** %21 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %22
%23 = or i64 %3, 16
%24 = getelementptr inbounds i8*, i8** %0, i64 %23
%25 = bitcast i8** %24 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %25
%26 = getelementptr inbounds i8*, i8** %24, i64 2
%27 = bitcast i8** %26 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %27
%28 = or i64 %3, 20
%29 = getelementptr inbounds i8*, i8** %0, i64 %28
%30 = bitcast i8** %29 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %30
%31 = getelementptr inbounds i8*, i8** %29, i64 2
%32 = bitcast i8** %31 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %32
%33 = or i64 %3, 24
%34 = getelementptr inbounds i8*, i8** %0, i64 %33
%35 = bitcast i8** %34 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %35
%36 = getelementptr inbounds i8*, i8** %34, i64 2
%37 = bitcast i8** %36 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %37
%38 = or i64 %3, 28
%39 = getelementptr inbounds i8*, i8** %0, i64 %38
%40 = bitcast i8** %39 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %40
%41 = getelementptr inbounds i8*, i8** %39, i64 2
%42 = bitcast i8** %41 to <2 x i8*>*
store <2 x i8*> <i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)>, <2 x i8*>* %42
%43 = add nuw nsw i64 %3, 32
%44 = icmp eq i64 %43, 256
br i1 %44, label %45, label %2
45: ; preds = %2
%46 = getelementptr inbounds i8*, i8** %0, i64 37
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %46
%47 = getelementptr inbounds i8*, i8** %0, i64 40
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %47
ret void
}