#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*/ strcpy(char *, char *);
void motif_initialization(char *motif, int motif_length) {
  switch (motif_length) {
  case 1:
    strcpy(motif, "n");
    break;
  case 2:
    strcpy(motif, "nn");
    break;
  case 3:
    strcpy(motif, "nnn");
    break;
  case 4:
    strcpy(motif, "nnnn");
    break;
  case 5:
    strcpy(motif, "nnnnn");
    break;
  case 6:
    strcpy(motif, "nnnnnn");
    break;
  case 7:
    strcpy(motif, "nnnnnnn");
    break;
  case 8:
    strcpy(motif, "nnnnnnnn");
    break;
  case 9:
    strcpy(motif, "nnnnnnnnn");
    break;
  case 10:
    strcpy(motif, "nnnnnnnnnn");
    break;
  case 11:
    strcpy(motif, "nnnnnnnnnnn");
    break;
  case 12:
    strcpy(motif, "nnnnnnnnnnnn");
    break;
  case 13:
    strcpy(motif, "nnnnnnnnnnnnn");
    break;
  case 14:
    strcpy(motif, "nnnnnnnnnnnnnn");
    break;
  case 15:
    strcpy(motif, "nnnnnnnnnnnnnnn");
    break;
  }
}


x86 assembly (clang, -O0):
<motif_initialization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xe,%eax
ja     127e <motif_initialization+0x16e>
mov    -0x18(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
lea    0xef7(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xee1(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xecb(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xe5d(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xe47(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xe31(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xe1b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xe05(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xdef(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xdd9(%rip),%rsi
call   1030 <strcpy@plt>
jmp    127e <motif_initialization+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xdc3(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<motif_initialization>:
add    $0xffffffff,%esi
cmp    $0xe,%esi
ja     112e <motif_initialization+0x1e>
movslq %esi,%rax
lea    0xeee(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
jmp    1030 <strcpy@plt>
ret

LLVM IR (-O0):
@.str = [2 x i8] c"n\00"
@.str.1 = [3 x i8] c"nn\00"
@.str.2 = [4 x i8] c"nnn\00"
@.str.3 = [5 x i8] c"nnnn\00"
@.str.4 = [6 x i8] c"nnnnn\00"
@.str.5 = [7 x i8] c"nnnnnn\00"
@.str.6 = [8 x i8] c"nnnnnnn\00"
@.str.7 = [9 x i8] c"nnnnnnnn\00"
@.str.8 = [10 x i8] c"nnnnnnnnn\00"
@.str.9 = [11 x i8] c"nnnnnnnnnn\00"
@.str.10 = [12 x i8] c"nnnnnnnnnnn\00"
@.str.11 = [13 x i8] c"nnnnnnnnnnnn\00"
@.str.12 = [14 x i8] c"nnnnnnnnnnnnn\00"
@.str.13 = [15 x i8] c"nnnnnnnnnnnnnn\00"
@.str.14 = [16 x i8] c"nnnnnnnnnnnnnnn\00"
define void @motif_initialization(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %51 [
i32 1, label %6
i32 2, label %9
i32 3, label %12
i32 4, label %15
i32 5, label %18
i32 6, label %21
i32 7, label %24
i32 8, label %27
i32 9, label %30
i32 10, label %33
i32 11, label %36
i32 12, label %39
i32 13, label %42
i32 14, label %45
i32 15, label %48
]
6: ; preds = %2
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %51
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %51
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %51
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %51
18: ; preds = %2
%19 = load i8*, i8** %3
%20 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %51
21: ; preds = %2
%22 = load i8*, i8** %3
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %51
24: ; preds = %2
%25 = load i8*, i8** %3
%26 = call i32 @strcpy(i8* %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %51
27: ; preds = %2
%28 = load i8*, i8** %3
%29 = call i32 @strcpy(i8* %28, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %51
30: ; preds = %2
%31 = load i8*, i8** %3
%32 = call i32 @strcpy(i8* %31, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
br label %51
33: ; preds = %2
%34 = load i8*, i8** %3
%35 = call i32 @strcpy(i8* %34, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
br label %51
36: ; preds = %2
%37 = load i8*, i8** %3
%38 = call i32 @strcpy(i8* %37, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
br label %51
39: ; preds = %2
%40 = load i8*, i8** %3
%41 = call i32 @strcpy(i8* %40, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
br label %51
42: ; preds = %2
%43 = load i8*, i8** %3
%44 = call i32 @strcpy(i8* %43, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0))
br label %51
45: ; preds = %2
%46 = load i8*, i8** %3
%47 = call i32 @strcpy(i8* %46, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0))
br label %51
48: ; preds = %2
%49 = load i8*, i8** %3
%50 = call i32 @strcpy(i8* %49, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0))
br label %51
51: ; preds = %2, %48, %45, %42, %39, %36, %33, %30, %27, %24, %21, %18, %15, %12, %9, %6
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"n\00"
@.str.1 = [3 x i8] c"nn\00"
@.str.2 = [4 x i8] c"nnn\00"
@.str.3 = [5 x i8] c"nnnn\00"
@.str.4 = [6 x i8] c"nnnnn\00"
@.str.5 = [7 x i8] c"nnnnnn\00"
@.str.6 = [8 x i8] c"nnnnnnn\00"
@.str.7 = [9 x i8] c"nnnnnnnn\00"
@.str.8 = [10 x i8] c"nnnnnnnnn\00"
@.str.9 = [11 x i8] c"nnnnnnnnnn\00"
@.str.10 = [12 x i8] c"nnnnnnnnnnn\00"
@.str.11 = [13 x i8] c"nnnnnnnnnnnn\00"
@.str.12 = [14 x i8] c"nnnnnnnnnnnnn\00"
@.str.13 = [15 x i8] c"nnnnnnnnnnnnnn\00"
@.str.14 = [16 x i8] c"nnnnnnnnnnnnnnn\00"
@reltable.motif_initialization = [15 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.3 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.4 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.5 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.6 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.7 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.8 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.9 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.10 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.11 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.12 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.13 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.14 to i64), i64 ptrtoint ([15 x i32]* @reltable.motif_initialization to i64)) to i32)]
define void @motif_initialization(i8* %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, 15
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([15 x i32]* @reltable.motif_initialization to i8*), i64 %7)
%9 = tail call i32 @strcpy(i8* %0, i8* %8)
br label %10
10: ; preds = %2, %5
ret void
}