#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 strlen(char *);
int encryptString(char *string) {
  int length = strlen(string), i = 0;
  while (i <= length - 1) {
    if ((i % 2) == 0) {
      string[i] += 2;
    } else {
      string[i] += 3;
    }
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<encryptString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     118b <encryptString+0x7b>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116b <encryptString+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
add    $0x2,%edx
mov    %dl,(%rax,%rcx,1)
jmp    117d <encryptString+0x6d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
add    $0x3,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112f <encryptString+0x1f>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encryptString>:
push   %rbx
sub    $0x90,%rsp
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    146f <encryptString+0x35f>
mov    %eax,%esi
cmp    $0x10,%eax
jae    1136 <encryptString+0x26>
xor    %eax,%eax
jmp    1450 <encryptString+0x340>
mov    %esi,%eax
and    $0xfffffff0,%eax
lea    -0x10(%rax),%rdx
mov    %rdx,%rcx
shr    $0x4,%rcx
add    $0x1,%rcx
test   %rdx,%rdx
je     147d <encryptString+0x36d>
mov    %rcx,%rdi
and    $0xfffffffffffffffe,%rdi
movdqa 0xeae(%rip),%xmm0
movdqa 0xeb6(%rip),%xmm1
movdqa 0xebd(%rip),%xmm8
movdqa 0xec5(%rip),%xmm6
movdqa 0xecd(%rip),%xmm4
movdqa 0xed5(%rip),%xmm5
movdqa 0xedd(%rip),%xmm2
movdqa 0xe65(%rip),%xmm3
xor    %edx,%edx
nopl   (%rax)
movdqa %xmm1,0x40(%rsp)
movdqa %xmm5,0x50(%rsp)
movdqa %xmm4,0x60(%rsp)
movdqa %xmm6,0x70(%rsp)
movdqa %xmm0,0x80(%rsp)
movdqa %xmm0,%xmm7
movdqa 0xeb3(%rip),%xmm0
pand   %xmm0,%xmm7
movdqa %xmm7,0x30(%rsp)
movdqa %xmm1,%xmm12
pand   %xmm0,%xmm12
movdqa %xmm8,%xmm7
movdqa %xmm8,0x20(%rsp)
pand   %xmm0,%xmm7
movdqa %xmm6,%xmm9
pand   %xmm0,%xmm9
movdqa %xmm4,%xmm11
pand   %xmm0,%xmm11
movdqa %xmm5,%xmm13
pand   %xmm0,%xmm13
movdqa %xmm2,%xmm15
pand   %xmm0,%xmm15
movdqa %xmm3,%xmm14
pand   %xmm0,%xmm14
movdqa %xmm14,%xmm6
pxor   %xmm4,%xmm4
pcmpeqd %xmm4,%xmm6
movdqa %xmm2,%xmm5
pshufd $0xb1,%xmm6,%xmm8
pand   %xmm6,%xmm8
movdqa %xmm15,%xmm6
pcmpeqd %xmm4,%xmm6
pshufd $0xb1,%xmm6,%xmm10
pand   %xmm6,%xmm10
packssdw %xmm10,%xmm8
movdqa %xmm13,%xmm6
pcmpeqd %xmm4,%xmm6
pshufd $0xb1,%xmm6,%xmm0
pand   %xmm6,%xmm0
movdqa %xmm11,%xmm6
pcmpeqd %xmm4,%xmm6
pshufd $0xb1,%xmm6,%xmm1
pand   %xmm6,%xmm1
packssdw %xmm1,%xmm0
packssdw %xmm0,%xmm8
movdqa %xmm9,%xmm0
pcmpeqd %xmm4,%xmm0
pshufd $0xb1,%xmm0,%xmm1
pand   %xmm0,%xmm1
movdqa %xmm7,(%rsp)
pcmpeqd %xmm4,%xmm7
pshufd $0xb1,%xmm7,%xmm6
pand   %xmm7,%xmm6
packssdw %xmm6,%xmm1
movdqa %xmm12,0x10(%rsp)
pcmpeqd %xmm4,%xmm12
pshufd $0xb1,%xmm12,%xmm6
pand   %xmm12,%xmm6
movdqa 0x30(%rsp),%xmm0
movdqa %xmm0,%xmm10
pcmpeqd %xmm4,%xmm0
pshufd $0xb1,%xmm0,%xmm2
pand   %xmm0,%xmm2
packssdw %xmm2,%xmm6
movdqa 0x20(%rsp),%xmm12
packssdw %xmm6,%xmm1
movdqa 0x70(%rsp),%xmm6
packsswb %xmm1,%xmm8
paddb  0xd91(%rip),%xmm8
movdqu (%rbx,%rdx,1),%xmm0
movdqu 0x10(%rbx,%rdx,1),%xmm1
paddb  %xmm8,%xmm0
movdqu %xmm0,(%rbx,%rdx,1)
movdqa 0x80(%rsp),%xmm0
paddb  %xmm8,%xmm1
movdqa %xmm5,%xmm2
movdqa 0x50(%rsp),%xmm5
movdqa 0x60(%rsp),%xmm4
movdqu %xmm1,0x10(%rbx,%rdx,1)
movdqa 0x40(%rsp),%xmm1
add    $0x20,%rdx
movdqa 0xd56(%rip),%xmm7
paddq  %xmm7,%xmm3
paddq  %xmm7,%xmm2
paddq  %xmm7,%xmm5
paddq  %xmm7,%xmm4
paddq  %xmm7,%xmm6
paddq  %xmm7,%xmm12
movdqa %xmm12,%xmm8
paddq  %xmm7,%xmm1
paddq  %xmm7,%xmm0
add    $0xfffffffffffffffe,%rdi
jne    11a0 <encryptString+0x90>
movdqa %xmm10,%xmm12
movdqa 0x10(%rsp),%xmm2
movdqa (%rsp),%xmm3
test   $0x1,%cl
je     1448 <encryptString+0x338>
pxor   %xmm10,%xmm10
movdqu (%rbx,%rdx,1),%xmm8
pcmpeqd %xmm10,%xmm14
pshufd $0xb1,%xmm14,%xmm4
pand   %xmm14,%xmm4
pcmpeqd %xmm10,%xmm15
pshufd $0xb1,%xmm15,%xmm0
pand   %xmm15,%xmm0
packssdw %xmm0,%xmm4
pcmpeqd %xmm10,%xmm13
pshufd $0xb1,%xmm13,%xmm0
pand   %xmm13,%xmm0
pcmpeqd %xmm10,%xmm11
pshufd $0xb1,%xmm11,%xmm1
pand   %xmm11,%xmm1
packssdw %xmm1,%xmm0
packssdw %xmm0,%xmm4
pcmpeqd %xmm10,%xmm9
pshufd $0xb1,%xmm9,%xmm0
pand   %xmm9,%xmm0
pcmpeqd %xmm10,%xmm3
pshufd $0xb1,%xmm3,%xmm1
pand   %xmm3,%xmm1
packssdw %xmm1,%xmm0
pcmpeqd %xmm10,%xmm2
pshufd $0xb1,%xmm2,%xmm1
pand   %xmm2,%xmm1
pcmpeqd %xmm10,%xmm12
pshufd $0xb1,%xmm12,%xmm2
pand   %xmm12,%xmm2
packssdw %xmm2,%xmm1
packssdw %xmm1,%xmm0
packsswb %xmm0,%xmm4
paddb  %xmm8,%xmm4
paddb  0xc4d(%rip),%xmm4
movdqu %xmm4,(%rbx,%rdx,1)
cmp    %rsi,%rax
je     146f <encryptString+0x35f>
nopl   (%rax)
mov    %eax,%edx
and    $0x1,%edx
movzbl (%rbx,%rax,1),%ecx
cmp    $0x1,%rdx
sbb    $0x0,%cl
add    $0x3,%cl
mov    %cl,(%rbx,%rax,1)
add    $0x1,%rax
cmp    %rax,%rsi
jne    1450 <encryptString+0x340>
mov    $0x1,%eax
add    $0x90,%rsp
pop    %rbx
ret
movdqa 0xb7a(%rip),%xmm14
xor    %edx,%edx
movdqa %xmm14,%xmm15
movdqa %xmm14,%xmm13
movdqa %xmm14,%xmm11
movdqa %xmm14,%xmm9
movdqa %xmm14,%xmm3
movdqa %xmm14,%xmm2
movdqa %xmm14,%xmm12
test   $0x1,%cl
jne    1393 <encryptString+0x283>
jmp    1448 <encryptString+0x338>

LLVM IR (-O0):
define i32 @encryptString(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %34, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = icmp sle i32 %8, %10
br i1 %11, label %12, label %37
12: ; preds = %7
%13 = load i32, i32* %4
%14 = srem i32 %13, 2
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %12
%17 = load i8*, i8** %2
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = add nsw i32 %22, 2
%24 = trunc i32 %23 to i8
store i8 %24, i8* %20
br label %34
25: ; preds = %12
%26 = load i8*, i8** %2
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = add nsw i32 %31, 3
%33 = trunc i32 %32 to i8
store i8 %33, i8* %29
br label %34
34: ; preds = %25, %16
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %7
37: ; preds = %7
ret i32 1
}

LLVM IR (-O2):
define i32 @encryptString(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %69
4: ; preds = %1
%5 = zext i32 %2 to i64
%6 = icmp ult i32 %2, 16
br i1 %6, label %57, label %7
7: ; preds = %4
%8 = and i64 %5, 4294967280
%9 = add nsw i64 %8, -16
%10 = lshr exact i64 %9, 4
%11 = add nuw nsw i64 %10, 1
%12 = and i64 %11, 1
%13 = icmp eq i64 %9, 0
br i1 %13, label %43, label %14
14: ; preds = %7
%15 = and i64 %11, 2305843009213693950
br label %16
16: ; preds = %16, %14
%17 = phi i64 [ 0, %14 ], [ %37, %16 ]
%18 = phi <16 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15>, %14 ], [ %38, %16 ]
%19 = phi i64 [ 0, %14 ], [ %39, %16 ]
%20 = and <16 x i64> %18, <i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1>
%21 = icmp eq <16 x i64> %20, zeroinitializer
%22 = getelementptr inbounds i8, i8* %0, i64 %17
%23 = bitcast i8* %22 to <16 x i8>*
%24 = load <16 x i8>, <16 x i8>* %23
%25 = select <16 x i1> %21, <16 x i8> <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>, <16 x i8> <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
%26 = add <16 x i8> %24, %25
%27 = bitcast i8* %22 to <16 x i8>*
store <16 x i8> %26, <16 x i8>* %27
%28 = or i64 %17, 16
%29 = and <16 x i64> %18, <i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1>
%30 = icmp eq <16 x i64> %29, zeroinitializer
%31 = getelementptr inbounds i8, i8* %0, i64 %28
%32 = bitcast i8* %31 to <16 x i8>*
%33 = load <16 x i8>, <16 x i8>* %32
%34 = select <16 x i1> %30, <16 x i8> <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>, <16 x i8> <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
%35 = add <16 x i8> %33, %34
%36 = bitcast i8* %31 to <16 x i8>*
store <16 x i8> %35, <16 x i8>* %36
%37 = add nuw i64 %17, 32
%38 = add <16 x i64> %18, <i64 32, i64 32, i64 32, i64 32, i64 32, i64 32, i64 32, i64 32, i64 32, i64 32, i64 32, i64 32, i64 32, i64 32, i64 32, i64 32>
%39 = add i64 %19, 2
%40 = icmp eq i64 %39, %15
br i1 %40, label %41, label %16
41: ; preds = %16
%42 = and <16 x i64> %18, <i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1>
br label %43
43: ; preds = %41, %7
%44 = phi i64 [ 0, %7 ], [ %37, %41 ]
%45 = phi <16 x i64> [ <i64 0, i64 1, i64 0, i64 1, i64 0, i64 1, i64 0, i64 1, i64 0, i64 1, i64 0, i64 1, i64 0, i64 1, i64 0, i64 1>, %7 ], [ %42, %41 ]
%46 = icmp eq i64 %12, 0
br i1 %46, label %55, label %47
47: ; preds = %43
%48 = icmp eq <16 x i64> %45, zeroinitializer
%49 = getelementptr inbounds i8, i8* %0, i64 %44
%50 = bitcast i8* %49 to <16 x i8>*
%51 = load <16 x i8>, <16 x i8>* %50
%52 = select <16 x i1> %48, <16 x i8> <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>, <16 x i8> <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
%53 = add <16 x i8> %51, %52
%54 = bitcast i8* %49 to <16 x i8>*
store <16 x i8> %53, <16 x i8>* %54
br label %55
55: ; preds = %43, %47
%56 = icmp eq i64 %8, %5
br i1 %56, label %69, label %57
57: ; preds = %4, %55
%58 = phi i64 [ 0, %4 ], [ %8, %55 ]
br label %59
59: ; preds = %57, %59
%60 = phi i64 [ %67, %59 ], [ %58, %57 ]
%61 = and i64 %60, 1
%62 = icmp eq i64 %61, 0
%63 = getelementptr inbounds i8, i8* %0, i64 %60
%64 = load i8, i8* %63
%65 = select i1 %62, i8 2, i8 3
%66 = add i8 %64, %65
store i8 %66, i8* %63
%67 = add nuw nsw i64 %60, 1
%68 = icmp eq i64 %67, %5
br i1 %68, label %69, label %59
69: ; preds = %59, %55, %1
ret i32 1
}