#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*/ printf(char *, ...);
int main() {
  char x[31];
  int i;
  x[0] = 0;
  x[1] = 0;
  x[2] = 0;
  x[3] = 0;
  x[4] = 1;
  for (i = 5; i < 31; i++)
    x[i] = x[i - 3] ^ x[i - 5];
  for (i = 0; i < 31; i++)
    printf("%i", x[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x30(%rbp)
movb   $0x0,-0x2f(%rbp)
movb   $0x0,-0x2e(%rbp)
movb   $0x0,-0x2d(%rbp)
movb   $0x1,-0x2c(%rbp)
movl   $0x5,-0x34(%rbp)
cmpl   $0x1f,-0x34(%rbp)
jge    1179 <main+0x69>
mov    -0x34(%rbp),%eax
sub    $0x3,%eax
cltq
movsbl -0x30(%rbp,%rax,1),%eax
mov    -0x34(%rbp),%ecx
sub    $0x5,%ecx
movslq %ecx,%rcx
movsbl -0x30(%rbp,%rcx,1),%ecx
xor    %ecx,%eax
mov    %al,%cl
movslq -0x34(%rbp),%rax
mov    %cl,-0x30(%rbp,%rax,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113a <main+0x2a>
movl   $0x0,-0x34(%rbp)
cmpl   $0x1f,-0x34(%rbp)
jge    11af <main+0x9f>
movslq -0x34(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%esi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1180 <main+0x70>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movl   $0x0,(%rsp)
movb   $0x1,0x4(%rsp)
mov    $0x6,%eax
cs nopw 0x0(%rax,%rax,1)
movzbl -0x6(%rsp,%rax,1),%ecx
xor    -0x4(%rsp,%rax,1),%cl
movzbl -0x5(%rsp,%rax,1),%edx
mov    %cl,-0x1(%rsp,%rax,1)
xor    -0x3(%rsp,%rax,1),%dl
mov    %dl,(%rsp,%rax,1)
add    $0x2,%rax
cmp    $0x20,%rax
jne    1140 <main+0x20>
lea    0xe96(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x1(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x2(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x3(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x5(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x6(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x7(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x9(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xa(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xb(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xd(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xe(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x11(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x12(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x13(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x15(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x16(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x17(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x19(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x1a(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x1b(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x1d(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x1e(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [31 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
store i8 0, i8* %4
%5 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 1
store i8 0, i8* %5
%6 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 2
store i8 0, i8* %6
%7 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 3
store i8 0, i8* %7
%8 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 4
store i8 1, i8* %8
store i32 5, i32* %3
br label %9
9: ; preds = %30, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 31
br i1 %11, label %12, label %33
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = xor i32 %18, %24
%26 = trunc i32 %25 to i8
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 %28
store i8 %26, i8* %29
br label %30
30: ; preds = %12
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %9
33: ; preds = %9
store i32 0, i32* %3
br label %34
34: ; preds = %44, %33
%35 = load i32, i32* %3
%36 = icmp slt i32 %35, 31
br i1 %36, label %37, label %47
37: ; preds = %34
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %37
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
store i32 %46, i32* %3
br label %34
47: ; preds = %34
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%49 = load i32, i32* %1
ret i32 %49
}

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