#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 */
unsigned char poly2(int *, int, int, int);
void makeseq2(unsigned char *s, int tap1, int tap2, int len) {
  int mem, i;
  mem = 0;
  for (i = 0; i < ((1 << 8) - 1); ++i)
    poly2(&mem, tap1, tap2, 1);
  for (i = 0; i < 2 * ((1 << 8) - 1); ++i)
    s[i] = poly2(&mem, tap1, tap2, 1);
}


x86 assembly (clang, -O0):
<makeseq2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xff,-0x1c(%rbp)
jge    1162 <makeseq2+0x52>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x18(%rbp),%rdi
mov    $0x1,%ecx
call   1030 <poly2@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1133 <makeseq2+0x23>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1fe,-0x1c(%rbp)
jge    11a5 <makeseq2+0x95>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x18(%rbp),%rdi
mov    $0x1,%ecx
call   1030 <poly2@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1169 <makeseq2+0x59>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeseq2>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r12d
mov    %esi,%ebp
mov    %rdi,%r14
movl   $0x0,0xc(%rsp)
mov    $0xff,%ebx
lea    0xc(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    $0x1,%ecx
call   1030 <poly2@plt>
add    $0xffffffff,%ebx
jne    1140 <makeseq2+0x30>
xor    %ebx,%ebx
lea    0xc(%rsp),%r15
xchg   %ax,%ax
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    $0x1,%ecx
call   1030 <poly2@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0x1fe,%rbx
jne    1160 <makeseq2+0x50>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @makeseq2(i8* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ 0, %4 ], [ %10, %7 ]
%9 = call zeroext i8 @poly2(i32* %5, i32 %1, i32 %2, i32 1)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, 255
br i1 %11, label %12, label %7
12: ; preds = %7, %12
%13 = phi i64 [ %16, %12 ], [ 0, %7 ]
%14 = call zeroext i8 @poly2(i32* %5, i32 %1, i32 %2, i32 1)
%15 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 %14, i8* %15
%16 = add nuw nsw i64 %13, 1
%17 = icmp eq i64 %16, 510
br i1 %17, label %18, label %12
18: ; preds = %12
ret void
}