#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 atoi(char const *);
int /*<<< orphan*/ strcat(char *, char const *);
int strlen(char *);
int createIkeaString(const char *pSystemStr, const char *pChannelStr,
                     const char *pLevelStr, const char *pDimStyle,
                     char *pStrReturn) {
  *pStrReturn = '\0';
  const char STARTCODE[] = "STTTTTTª";
  const char TT[] = "TT";
  const char A[] = "ª";
  int systemCode = atoi(pSystemStr) - 1;
  int channelCode = atoi(pChannelStr);
  int Level = atoi(pLevelStr);
  int DimStyle = atoi(pDimStyle);
  int intCode = 0;
  int checksum1 = 0;
  int checksum2 = 0;
  int intFade;
  int i;
  int rawChannelCode = 0;
  if ((channelCode <= 0) || (channelCode > 10) || (systemCode < 0) ||
      (systemCode > 15) || (Level < 0) || (Level > 10) || (DimStyle < 0) ||
      (DimStyle > 1)) {
    return 0;
  }
  if (channelCode == 10) {
    channelCode = 0;
  }
  rawChannelCode = (1 << (9 - channelCode));
  strcat(pStrReturn, STARTCODE);
  intCode = (systemCode << 10) | rawChannelCode;
  for (i = 13; i >= 0; --i) {
    if ((intCode >> i) & 1) {
      strcat(pStrReturn, TT);
      if (i % 2 == 0) {
        checksum2++;
      } else {
        checksum1++;
      }
    } else {
      strcat(pStrReturn, A);
    }
  }
  if (checksum1 % 2 == 0) {
    strcat(pStrReturn, TT);
  } else {
    strcat(pStrReturn, A);
  }
  if (checksum2 % 2 == 0) {
    strcat(pStrReturn, TT);
  } else {
    strcat(pStrReturn, A);
  }
  if (DimStyle == 1) {
    intFade = 11 << 4;
  } else {
    intFade = 1 << 4;
  }
  switch (Level) {
  case 0:
    intCode = (10 | intFade);
    break;
  case 1:
    intCode = (1 | intFade);
    break;
  case 2:
    intCode = (2 | intFade);
    break;
  case 3:
    intCode = (3 | intFade);
    break;
  case 4:
    intCode = (4 | intFade);
    break;
  case 5:
    intCode = (5 | intFade);
    break;
  case 6:
    intCode = (6 | intFade);
    break;
  case 7:
    intCode = (7 | intFade);
    break;
  case 8:
    intCode = (8 | intFade);
    break;
  case 9:
    intCode = (9 | intFade);
    break;
  case 10:
  default:
    intCode = (0 | intFade);
    break;
  }
  checksum1 = 0;
  checksum2 = 0;
  for (i = 0; i < 6; ++i) {
    if ((intCode >> i) & 1) {
      strcat(pStrReturn, TT);
      if (i % 2 == 0) {
        checksum1++;
      } else {
        checksum2++;
      }
    } else {
      strcat(pStrReturn, A);
    }
  }
  if (checksum1 % 2 == 0) {
    strcat(pStrReturn, TT);
  } else {
    strcat(pStrReturn, A);
  }
  if (checksum2 % 2 == 0) {
    strcat(pStrReturn, TT);
  } else {
    strcat(pStrReturn, A);
  }
  strcat(pStrReturn, "+");
  return strlen(pStrReturn);
}


x86 assembly (clang, -O0):
<createIkeaString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
mov    0xed2(%rip),%rax
mov    %rax,-0x3a(%rbp)
mov    0xecf(%rip),%ax
mov    %ax,-0x32(%rbp)
mov    0xec6(%rip),%ax
mov    %ax,-0x3d(%rbp)
mov    0xebe(%rip),%al
mov    %al,-0x3b(%rbp)
mov    0xeaf(%rip),%ax
mov    %ax,-0x40(%rbp)
mov    0xea7(%rip),%al
mov    %al,-0x3e(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
sub    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x68(%rbp)
cmpl   $0x0,-0x48(%rbp)
jle    1230 <createIkeaString+0x100>
cmpl   $0xa,-0x48(%rbp)
jg     1230 <createIkeaString+0x100>
cmpl   $0x0,-0x44(%rbp)
jl     1230 <createIkeaString+0x100>
cmpl   $0xf,-0x44(%rbp)
jg     1230 <createIkeaString+0x100>
cmpl   $0x0,-0x4c(%rbp)
jl     1230 <createIkeaString+0x100>
cmpl   $0xa,-0x4c(%rbp)
jg     1230 <createIkeaString+0x100>
cmpl   $0x0,-0x50(%rbp)
jl     1230 <createIkeaString+0x100>
cmpl   $0x1,-0x50(%rbp)
jle    123c <createIkeaString+0x10c>
movl   $0x0,-0x4(%rbp)
jmp    154e <createIkeaString+0x41e>
cmpl   $0xa,-0x48(%rbp)
jne    124d <createIkeaString+0x11d>
movl   $0x0,-0x48(%rbp)
mov    $0x9,%ecx
sub    -0x48(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x68(%rbp)
mov    -0x30(%rbp),%rdi
lea    -0x3a(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x44(%rbp),%eax
shl    $0xa,%eax
or     -0x68(%rbp),%eax
mov    %eax,-0x54(%rbp)
movl   $0xd,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
jl     12fa <createIkeaString+0x1ca>
mov    -0x54(%rbp),%eax
mov    -0x64(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     12da <createIkeaString+0x1aa>
mov    -0x30(%rbp),%rdi
lea    -0x3d(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x64(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12cc <createIkeaString+0x19c>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    12d5 <createIkeaString+0x1a5>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    12e7 <createIkeaString+0x1b7>
mov    -0x30(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <strcat@plt>
jmp    12ec <createIkeaString+0x1bc>
mov    -0x64(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x64(%rbp)
jmp    127f <createIkeaString+0x14f>
mov    -0x58(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1320 <createIkeaString+0x1f0>
mov    -0x30(%rbp),%rdi
lea    -0x3d(%rbp),%rsi
call   1050 <strcat@plt>
jmp    132d <createIkeaString+0x1fd>
mov    -0x30(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x5c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1353 <createIkeaString+0x223>
mov    -0x30(%rbp),%rdi
lea    -0x3d(%rbp),%rsi
call   1050 <strcat@plt>
jmp    1360 <createIkeaString+0x230>
mov    -0x30(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <strcat@plt>
cmpl   $0x1,-0x50(%rbp)
jne    1376 <createIkeaString+0x246>
movl   $0xb0,-0x60(%rbp)
jmp    137d <createIkeaString+0x24d>
movl   $0x10,-0x60(%rbp)
mov    -0x4c(%rbp),%eax
mov    %rax,-0x70(%rbp)
sub    $0xa,%rax
ja     1433 <createIkeaString+0x303>
mov    -0x70(%rbp),%rax
lea    0xc67(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x60(%rbp),%eax
or     $0xa,%eax
mov    %eax,-0x54(%rbp)
jmp    143c <createIkeaString+0x30c>
mov    -0x60(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    143c <createIkeaString+0x30c>
mov    -0x60(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x54(%rbp)
jmp    143c <createIkeaString+0x30c>
mov    -0x60(%rbp),%eax
or     $0x3,%eax
mov    %eax,-0x54(%rbp)
jmp    143c <createIkeaString+0x30c>
mov    -0x60(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x54(%rbp)
jmp    143c <createIkeaString+0x30c>
mov    -0x60(%rbp),%eax
or     $0x5,%eax
mov    %eax,-0x54(%rbp)
jmp    143c <createIkeaString+0x30c>
mov    -0x60(%rbp),%eax
or     $0x6,%eax
mov    %eax,-0x54(%rbp)
jmp    143c <createIkeaString+0x30c>
mov    -0x60(%rbp),%eax
or     $0x7,%eax
mov    %eax,-0x54(%rbp)
jmp    143c <createIkeaString+0x30c>
mov    -0x60(%rbp),%eax
or     $0x8,%eax
mov    %eax,-0x54(%rbp)
jmp    143c <createIkeaString+0x30c>
mov    -0x60(%rbp),%eax
or     $0x9,%eax
mov    %eax,-0x54(%rbp)
jmp    143c <createIkeaString+0x30c>
jmp    1433 <createIkeaString+0x303>
mov    -0x60(%rbp),%eax
or     $0x0,%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x64(%rbp)
cmpl   $0x6,-0x64(%rbp)
jge    14cc <createIkeaString+0x39c>
mov    -0x54(%rbp),%eax
mov    -0x64(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     14ac <createIkeaString+0x37c>
mov    -0x30(%rbp),%rdi
lea    -0x3d(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x64(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    149e <createIkeaString+0x36e>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    14a7 <createIkeaString+0x377>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    14b9 <createIkeaString+0x389>
mov    -0x30(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <strcat@plt>
jmp    14be <createIkeaString+0x38e>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1451 <createIkeaString+0x321>
mov    -0x58(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    14f2 <createIkeaString+0x3c2>
mov    -0x30(%rbp),%rdi
lea    -0x3d(%rbp),%rsi
call   1050 <strcat@plt>
jmp    14ff <createIkeaString+0x3cf>
mov    -0x30(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x5c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1525 <createIkeaString+0x3f5>
mov    -0x30(%rbp),%rdi
lea    -0x3d(%rbp),%rsi
call   1050 <strcat@plt>
jmp    1532 <createIkeaString+0x402>
mov    -0x30(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x30(%rbp),%rdi
lea    0xafc(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createIkeaString>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%r15
mov    %rcx,%r14
mov    %rdx,%r13
mov    %rsi,%rbx
movb   $0x0,(%r8)
movabs $0xc254545454545453,%rax
54 54 c2
mov    %rax,0x18(%rsp)
movw   $0xaa,0x20(%rsp)
movb   $0x0,0xe(%rsp)
movw   $0x5454,0xc(%rsp)
movb   $0x0,0xa(%rsp)
movw   $0xaac2,0x8(%rsp)
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <atoi@plt>
mov    %eax,%r12d
mov    %r13,%rdi
call   1040 <atoi@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1040 <atoi@plt>
mov    %eax,%edx
lea    -0xb(%r12),%ecx
xor    %eax,%eax
cmp    $0xfffffff6,%ecx
jb     13f4 <createIkeaString+0x2c4>
test   %ebp,%ebp
jle    13f4 <createIkeaString+0x2c4>
cmp    $0x10,%ebp
jg     13f4 <createIkeaString+0x2c4>
test   %ebx,%ebx
js     13f4 <createIkeaString+0x2c4>
cmp    $0xa,%ebx
jg     13f4 <createIkeaString+0x2c4>
test   %edx,%edx
js     13f4 <createIkeaString+0x2c4>
cmp    $0x1,%edx
jg     13f4 <createIkeaString+0x2c4>
mov    %edx,0x10(%rsp)
mov    %ebx,0x14(%rsp)
mov    $0x9,%cl
sub    %r12b,%cl
mov    $0x1,%eax
shl    %cl,%eax
cmp    $0xa,%r12d
mov    $0x200,%ebx
cmovne %eax,%ebx
lea    0x18(%rsp),%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
shl    $0xa,%ebp
add    $0xfffffc00,%ebp
or     %ebx,%ebp
xor    %r12d,%r12d
mov    $0xd,%ebx
lea    0xc(%rsp),%r13
xor    %r14d,%r14d
jmp    123f <createIkeaString+0x10f>
nop
lea    0x8(%rsp),%rsi
call   1050 <strcat@plt>
add    $0xffffffff,%ebx
jae    1266 <createIkeaString+0x136>
mov    %r15,%rdi
bt     %ebx,%ebp
jae    1230 <createIkeaString+0x100>
mov    %r13,%rsi
call   1050 <strcat@plt>
test   $0x1,%bl
jne    1260 <createIkeaString+0x130>
add    $0x1,%r12d
jmp    123a <createIkeaString+0x10a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14d
jmp    123a <createIkeaString+0x10a>
test   $0x1,%r14b
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
cmove  %r13,%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
test   $0x1,%r12b
mov    %rbx,%rsi
cmove  %r13,%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
cmpl   $0x1,0x10(%rsp)
mov    $0xb0,%eax
mov    $0x10,%ebp
cmove  %eax,%ebp
mov    0x14(%rsp),%eax
cmp    $0x9,%eax
ja     12ee <createIkeaString+0x1be>
mov    %eax,%eax
lea    0xd4b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
or     $0xa,%ebp
jmp    12ee <createIkeaString+0x1be>
or     $0x1,%ebp
jmp    12ee <createIkeaString+0x1be>
or     $0x2,%ebp
jmp    12ee <createIkeaString+0x1be>
or     $0x3,%ebp
jmp    12ee <createIkeaString+0x1be>
or     $0x4,%ebp
jmp    12ee <createIkeaString+0x1be>
or     $0x5,%ebp
jmp    12ee <createIkeaString+0x1be>
or     $0x6,%ebp
jmp    12ee <createIkeaString+0x1be>
or     $0x7,%ebp
jmp    12ee <createIkeaString+0x1be>
or     $0x8,%ebp
jmp    12ee <createIkeaString+0x1be>
or     $0x9,%ebp
test   $0x1,%bpl
mov    %r13,%rsi
lea    0x8(%rsp),%rbx
cmove  %rbx,%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
mov    %ebp,%r12d
and    $0x2,%r12d
cmove  %rbx,%r13
mov    %r15,%rdi
mov    %r13,%rsi
call   1050 <strcat@plt>
mov    %ebp,%ebx
and    $0x1,%ebx
test   $0x4,%bpl
jne    1357 <createIkeaString+0x227>
lea    0x8(%rsp),%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
test   $0x8,%bpl
je     136d <createIkeaString+0x23d>
lea    0xc(%rsp),%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
cmp    $0x1,%r12d
mov    $0x2,%r12d
sbb    $0x0,%r12d
jmp    137d <createIkeaString+0x24d>
lea    0xc(%rsp),%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
add    $0x1,%ebx
test   $0x8,%bpl
jne    133a <createIkeaString+0x20a>
shr    %r12d
lea    0x8(%rsp),%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
lea    0xc(%rsp),%r13
mov    %r15,%rdi
mov    %r13,%rsi
call   1050 <strcat@plt>
test   $0x20,%bpl
jne    13a2 <createIkeaString+0x272>
lea    0x8(%rsp),%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
jmp    13b3 <createIkeaString+0x283>
lea    0xc(%rsp),%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
add    $0x1,%r12d
test   $0x1,%bl
mov    %r13,%rsi
lea    0x8(%rsp),%rbx
cmove  %rbx,%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
test   $0x1,%r12b
cmove  %r13,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
lea    0xc51(%rip),%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
mov    %r15,%rdi
call   1030 <strlen@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.createIkeaString.STARTCODE = [10 x i8] c"STTTTTT\C2\AA\00"
@__const.createIkeaString.TT = [3 x i8] c"TT\00"
@__const.createIkeaString.A = [3 x i8] c"\C2\AA\00"
@.str = [2 x i8] c"+\00"
define i32 @createIkeaString(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca [10 x i8]
%13 = alloca [3 x i8]
%14 = alloca [3 x i8]
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
%25 = load i8*, i8** %11
store i8 0, i8* %25
%26 = bitcast [10 x i8]* %12 to i8*
%27 = bitcast [3 x i8]* %13 to i8*
%28 = bitcast [3 x i8]* %14 to i8*
%29 = load i8*, i8** %7
%30 = call i32 @atoi(i8* %29)
%31 = sub nsw i32 %30, 1
store i32 %31, i32* %15
%32 = load i8*, i8** %8
%33 = call i32 @atoi(i8* %32)
store i32 %33, i32* %16
%34 = load i8*, i8** %9
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %17
%36 = load i8*, i8** %10
%37 = call i32 @atoi(i8* %36)
store i32 %37, i32* %18
store i32 0, i32* %19
store i32 0, i32* %20
store i32 0, i32* %21
store i32 0, i32* %24
%38 = load i32, i32* %16
%39 = icmp sle i32 %38, 0
br i1 %39, label %61, label %40
40: ; preds = %5
%41 = load i32, i32* %16
%42 = icmp sgt i32 %41, 10
br i1 %42, label %61, label %43
43: ; preds = %40
%44 = load i32, i32* %15
%45 = icmp slt i32 %44, 0
br i1 %45, label %61, label %46
46: ; preds = %43
%47 = load i32, i32* %15
%48 = icmp sgt i32 %47, 15
br i1 %48, label %61, label %49
49: ; preds = %46
%50 = load i32, i32* %17
%51 = icmp slt i32 %50, 0
br i1 %51, label %61, label %52
52: ; preds = %49
%53 = load i32, i32* %17
%54 = icmp sgt i32 %53, 10
br i1 %54, label %61, label %55
55: ; preds = %52
%56 = load i32, i32* %18
%57 = icmp slt i32 %56, 0
br i1 %57, label %61, label %58
58: ; preds = %55
%59 = load i32, i32* %18
%60 = icmp sgt i32 %59, 1
br i1 %60, label %61, label %62
61: ; preds = %58, %55, %52, %49, %46, %43, %40, %5
store i32 0, i32* %6
br label %234
62: ; preds = %58
%63 = load i32, i32* %16
%64 = icmp eq i32 %63, 10
br i1 %64, label %65, label %66
65: ; preds = %62
store i32 0, i32* %16
br label %66
66: ; preds = %65, %62
%67 = load i32, i32* %16
%68 = sub nsw i32 9, %67
%69 = shl i32 1, %68
store i32 %69, i32* %24
%70 = load i8*, i8** %11
%71 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%72 = call i32 @strcat(i8* %70, i8* %71)
%73 = load i32, i32* %15
%74 = shl i32 %73, 10
%75 = load i32, i32* %24
%76 = or i32 %74, %75
store i32 %76, i32* %19
store i32 13, i32* %23
br label %77
77: ; preds = %105, %66
%78 = load i32, i32* %23
%79 = icmp sge i32 %78, 0
br i1 %79, label %80, label %108
80: ; preds = %77
%81 = load i32, i32* %19
%82 = load i32, i32* %23
%83 = ashr i32 %81, %82
%84 = and i32 %83, 1
%85 = icmp ne i32 %84, 0
br i1 %85, label %86, label %100
86: ; preds = %80
%87 = load i8*, i8** %11
%88 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%89 = call i32 @strcat(i8* %87, i8* %88)
%90 = load i32, i32* %23
%91 = srem i32 %90, 2
%92 = icmp eq i32 %91, 0
br i1 %92, label %93, label %96
93: ; preds = %86
%94 = load i32, i32* %21
%95 = add nsw i32 %94, 1
store i32 %95, i32* %21
br label %99
96: ; preds = %86
%97 = load i32, i32* %20
%98 = add nsw i32 %97, 1
store i32 %98, i32* %20
br label %99
99: ; preds = %96, %93
br label %104
100: ; preds = %80
%101 = load i8*, i8** %11
%102 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%103 = call i32 @strcat(i8* %101, i8* %102)
br label %104
104: ; preds = %100, %99
br label %105
105: ; preds = %104
%106 = load i32, i32* %23
%107 = add nsw i32 %106, -1
store i32 %107, i32* %23
br label %77
108: ; preds = %77
%109 = load i32, i32* %20
%110 = srem i32 %109, 2
%111 = icmp eq i32 %110, 0
br i1 %111, label %112, label %116
112: ; preds = %108
%113 = load i8*, i8** %11
%114 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%115 = call i32 @strcat(i8* %113, i8* %114)
br label %120
116: ; preds = %108
%117 = load i8*, i8** %11
%118 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%119 = call i32 @strcat(i8* %117, i8* %118)
br label %120
120: ; preds = %116, %112
%121 = load i32, i32* %21
%122 = srem i32 %121, 2
%123 = icmp eq i32 %122, 0
br i1 %123, label %124, label %128
124: ; preds = %120
%125 = load i8*, i8** %11
%126 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%127 = call i32 @strcat(i8* %125, i8* %126)
br label %132
128: ; preds = %120
%129 = load i8*, i8** %11
%130 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%131 = call i32 @strcat(i8* %129, i8* %130)
br label %132
132: ; preds = %128, %124
%133 = load i32, i32* %18
%134 = icmp eq i32 %133, 1
br i1 %134, label %135, label %136
135: ; preds = %132
store i32 176, i32* %22
br label %137
136: ; preds = %132
store i32 16, i32* %22
br label %137
137: ; preds = %136, %135
%138 = load i32, i32* %17
switch i32 %138, label %170 [
i32 0, label %139
i32 1, label %142
i32 2, label %145
i32 3, label %148
i32 4, label %151
i32 5, label %154
i32 6, label %157
i32 7, label %160
i32 8, label %163
i32 9, label %166
i32 10, label %169
]
139: ; preds = %137
%140 = load i32, i32* %22
%141 = or i32 10, %140
store i32 %141, i32* %19
br label %173
142: ; preds = %137
%143 = load i32, i32* %22
%144 = or i32 1, %143
store i32 %144, i32* %19
br label %173
145: ; preds = %137
%146 = load i32, i32* %22
%147 = or i32 2, %146
store i32 %147, i32* %19
br label %173
148: ; preds = %137
%149 = load i32, i32* %22
%150 = or i32 3, %149
store i32 %150, i32* %19
br label %173
151: ; preds = %137
%152 = load i32, i32* %22
%153 = or i32 4, %152
store i32 %153, i32* %19
br label %173
154: ; preds = %137
%155 = load i32, i32* %22
%156 = or i32 5, %155
store i32 %156, i32* %19
br label %173
157: ; preds = %137
%158 = load i32, i32* %22
%159 = or i32 6, %158
store i32 %159, i32* %19
br label %173
160: ; preds = %137
%161 = load i32, i32* %22
%162 = or i32 7, %161
store i32 %162, i32* %19
br label %173
163: ; preds = %137
%164 = load i32, i32* %22
%165 = or i32 8, %164
store i32 %165, i32* %19
br label %173
166: ; preds = %137
%167 = load i32, i32* %22
%168 = or i32 9, %167
store i32 %168, i32* %19
br label %173
169: ; preds = %137
br label %170
170: ; preds = %137, %169
%171 = load i32, i32* %22
%172 = or i32 0, %171
store i32 %172, i32* %19
br label %173
173: ; preds = %170, %166, %163, %160, %157, %154, %151, %148, %145, %142, %139
store i32 0, i32* %20
store i32 0, i32* %21
store i32 0, i32* %23
br label %174
174: ; preds = %202, %173
%175 = load i32, i32* %23
%176 = icmp slt i32 %175, 6
br i1 %176, label %177, label %205
177: ; preds = %174
%178 = load i32, i32* %19
%179 = load i32, i32* %23
%180 = ashr i32 %178, %179
%181 = and i32 %180, 1
%182 = icmp ne i32 %181, 0
br i1 %182, label %183, label %197
183: ; preds = %177
%184 = load i8*, i8** %11
%185 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%186 = call i32 @strcat(i8* %184, i8* %185)
%187 = load i32, i32* %23
%188 = srem i32 %187, 2
%189 = icmp eq i32 %188, 0
br i1 %189, label %190, label %193
190: ; preds = %183
%191 = load i32, i32* %20
%192 = add nsw i32 %191, 1
store i32 %192, i32* %20
br label %196
193: ; preds = %183
%194 = load i32, i32* %21
%195 = add nsw i32 %194, 1
store i32 %195, i32* %21
br label %196
196: ; preds = %193, %190
br label %201
197: ; preds = %177
%198 = load i8*, i8** %11
%199 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%200 = call i32 @strcat(i8* %198, i8* %199)
br label %201
201: ; preds = %197, %196
br label %202
202: ; preds = %201
%203 = load i32, i32* %23
%204 = add nsw i32 %203, 1
store i32 %204, i32* %23
br label %174
205: ; preds = %174
%206 = load i32, i32* %20
%207 = srem i32 %206, 2
%208 = icmp eq i32 %207, 0
br i1 %208, label %209, label %213
209: ; preds = %205
%210 = load i8*, i8** %11
%211 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%212 = call i32 @strcat(i8* %210, i8* %211)
br label %217
213: ; preds = %205
%214 = load i8*, i8** %11
%215 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%216 = call i32 @strcat(i8* %214, i8* %215)
br label %217
217: ; preds = %213, %209
%218 = load i32, i32* %21
%219 = srem i32 %218, 2
%220 = icmp eq i32 %219, 0
br i1 %220, label %221, label %225
221: ; preds = %217
%222 = load i8*, i8** %11
%223 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%224 = call i32 @strcat(i8* %222, i8* %223)
br label %229
225: ; preds = %217
%226 = load i8*, i8** %11
%227 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%228 = call i32 @strcat(i8* %226, i8* %227)
br label %229
229: ; preds = %225, %221
%230 = load i8*, i8** %11
%231 = call i32 @strcat(i8* %230, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%232 = load i8*, i8** %11
%233 = call i32 @strlen(i8* %232)
store i32 %233, i32* %6
br label %234
234: ; preds = %229, %61
%235 = load i32, i32* %6
ret i32 %235
}

LLVM IR (-O2):
@__const.createIkeaString.STARTCODE = [10 x i8] c"STTTTTT\C2\AA\00"
@__const.createIkeaString.TT = [3 x i8] c"TT\00"
@__const.createIkeaString.A = [3 x i8] c"\C2\AA\00"
@.str = [2 x i8] c"+\00"
define i32 @createIkeaString(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3, i8* %4) {
%6 = alloca [10 x i8]
%7 = alloca [3 x i8]
%8 = alloca [3 x i8]
store i8 0, i8* %4
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 0
%12 = tail call i32 @atoi(i8* %0)
%13 = tail call i32 @atoi(i8* %1)
%14 = tail call i32 @atoi(i8* %2)
%15 = tail call i32 @atoi(i8* %3)
%16 = add i32 %13, -11
%17 = icmp ult i32 %16, -10
%18 = icmp slt i32 %12, 1
%19 = select i1 %17, i1 true, i1 %18
%20 = icmp sgt i32 %12, 16
%21 = select i1 %19, i1 true, i1 %20
%22 = icmp slt i32 %14, 0
%23 = select i1 %21, i1 true, i1 %22
%24 = icmp sgt i32 %14, 10
%25 = select i1 %23, i1 true, i1 %24
%26 = icmp slt i32 %15, 0
%27 = select i1 %25, i1 true, i1 %26
%28 = icmp sgt i32 %15, 1
%29 = select i1 %27, i1 true, i1 %28
br i1 %29, label %144, label %30
30: ; preds = %5
%31 = icmp eq i32 %13, 10
%32 = sub nsw i32 9, %13
%33 = shl nuw nsw i32 1, %32
%34 = select i1 %31, i32 512, i32 %33
%35 = call i32 @strcat(i8* %4, i8* %9)
%36 = shl nuw nsw i32 %12, 10
%37 = add nsw i32 %36, -1024
%38 = or i32 %34, %37
br label %39
39: ; preds = %30, %56
%40 = phi i32 [ 13, %30 ], [ %59, %56 ]
%41 = phi i32 [ 0, %30 ], [ %58, %56 ]
%42 = phi i32 [ 0, %30 ], [ %57, %56 ]
%43 = shl nuw i32 1, %40
%44 = and i32 %43, %38
%45 = icmp eq i32 %44, 0
br i1 %45, label %54, label %46
46: ; preds = %39
%47 = call i32 @strcat(i8* %4, i8* %10)
%48 = and i32 %40, 1
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %46
%51 = add nsw i32 %41, 1
br label %56
52: ; preds = %46
%53 = add nsw i32 %42, 1
br label %56
54: ; preds = %39
%55 = call i32 @strcat(i8* %4, i8* %11)
br label %56
56: ; preds = %54, %52, %50
%57 = phi i32 [ %42, %50 ], [ %53, %52 ], [ %42, %54 ]
%58 = phi i32 [ %51, %50 ], [ %41, %52 ], [ %41, %54 ]
%59 = add nsw i32 %40, -1
%60 = icmp eq i32 %40, 0
br i1 %60, label %61, label %39
61: ; preds = %56
%62 = and i32 %57, 1
%63 = icmp eq i32 %62, 0
%64 = select i1 %63, i8* %10, i8* %11
%65 = call i32 @strcat(i8* %4, i8* %64)
%66 = and i32 %58, 1
%67 = icmp eq i32 %66, 0
%68 = select i1 %67, i8* %10, i8* %11
%69 = call i32 @strcat(i8* %4, i8* %68)
%70 = icmp eq i32 %15, 1
%71 = select i1 %70, i32 176, i32 16
switch i32 %14, label %92 [
i32 0, label %72
i32 1, label %74
i32 2, label %76
i32 3, label %78
i32 4, label %80
i32 5, label %82
i32 6, label %84
i32 7, label %86
i32 8, label %88
i32 9, label %90
]
72: ; preds = %61
%73 = or i32 %71, 10
br label %92
74: ; preds = %61
%75 = or i32 %71, 1
br label %92
76: ; preds = %61
%77 = or i32 %71, 2
br label %92
78: ; preds = %61
%79 = or i32 %71, 3
br label %92
80: ; preds = %61
%81 = or i32 %71, 4
br label %92
82: ; preds = %61
%83 = or i32 %71, 5
br label %92
84: ; preds = %61
%85 = or i32 %71, 6
br label %92
86: ; preds = %61
%87 = or i32 %71, 7
br label %92
88: ; preds = %61
%89 = or i32 %71, 8
br label %92
90: ; preds = %61
%91 = or i32 %71, 9
br label %92
92: ; preds = %61, %90, %88, %86, %84, %82, %80, %78, %76, %74, %72
%93 = phi i32 [ %91, %90 ], [ %89, %88 ], [ %87, %86 ], [ %85, %84 ], [ %83, %82 ], [ %81, %80 ], [ %79, %78 ], [ %77, %76 ], [ %75, %74 ], [ %73, %72 ], [ %71, %61 ]
%94 = and i32 %93, 1
%95 = icmp eq i32 %94, 0
%96 = select i1 %95, i8* %11, i8* %10
%97 = call i32 @strcat(i8* %4, i8* %96)
%98 = and i32 %93, 2
%99 = icmp eq i32 %98, 0
%100 = select i1 %99, i8* %11, i8* %10
%101 = xor i1 %99, true
%102 = zext i1 %101 to i32
%103 = call i32 @strcat(i8* %4, i8* %100)
%104 = and i32 %93, 4
%105 = icmp eq i32 %104, 0
br i1 %105, label %109, label %106
106: ; preds = %92
%107 = call i32 @strcat(i8* %4, i8* %10)
%108 = select i1 %95, i32 1, i32 2
br label %113
109: ; preds = %92
%110 = xor i1 %95, true
%111 = zext i1 %110 to i32
%112 = call i32 @strcat(i8* %4, i8* %11)
br label %113
113: ; preds = %109, %106
%114 = phi i32 [ %108, %106 ], [ %111, %109 ]
%115 = and i32 %93, 8
%116 = icmp eq i32 %115, 0
br i1 %116, label %120, label %117
117: ; preds = %113
%118 = call i32 @strcat(i8* %4, i8* %10)
%119 = select i1 %99, i32 1, i32 2
br label %122
120: ; preds = %113
%121 = call i32 @strcat(i8* %4, i8* %11)
br label %122
122: ; preds = %117, %120
%123 = phi i32 [ %119, %117 ], [ %102, %120 ]
%124 = call i32 @strcat(i8* %4, i8* %10)
%125 = and i32 %114, 1
%126 = and i32 %93, 32
%127 = icmp eq i32 %126, 0
br i1 %127, label %131, label %128
128: ; preds = %122
%129 = call i32 @strcat(i8* %4, i8* %10)
%130 = add nuw nsw i32 %123, 1
br label %133
131: ; preds = %122
%132 = call i32 @strcat(i8* %4, i8* %11)
br label %133
133: ; preds = %131, %128
%134 = phi i32 [ %130, %128 ], [ %123, %131 ]
%135 = icmp eq i32 %125, 0
%136 = select i1 %135, i8* %11, i8* %10
%137 = call i32 @strcat(i8* %4, i8* %136)
%138 = and i32 %134, 1
%139 = icmp eq i32 %138, 0
%140 = select i1 %139, i8* %10, i8* %11
%141 = call i32 @strcat(i8* %4, i8* %140)
%142 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%143 = call i32 @strlen(i8* %4)
br label %144
144: ; preds = %5, %133
%145 = phi i32 [ %143, %133 ], [ 0, %5 ]
ret i32 %145
}