#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
void createsequence(FILE *file, char *sequencearray) {
  int c;
  int seqcounter = 0;
  int i = 0;
  if (file) {
    while ((c = fgetc(file)) != EOF) {
      sequencearray[i] = c;
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<createsequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117c <createsequence+0x6c>
jmp    113e <createsequence+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
je     1177 <createsequence+0x67>
mov    -0x14(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113e <createsequence+0x2e>
jmp    117c <createsequence+0x6c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createsequence>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1153 <createsequence+0x43>
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <fgetc@plt>
mov    0x2ebc(%rip),%r15
cmp    (%r15),%eax
je     1153 <createsequence+0x43>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %al,(%rbx)
mov    %r14,%rdi
call   1030 <fgetc@plt>
add    $0x1,%rbx
cmp    (%r15),%eax
jne    1140 <createsequence+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @createsequence(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load i32*, i32** %3
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %26
10: ; preds = %2
br label %11
11: ; preds = %16, %10
%12 = load i32*, i32** %3
%13 = call i32 @fgetc(i32* %12)
store i32 %13, i32* %5
%14 = load i32, i32* @EOF
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %25
16: ; preds = %11
%17 = load i32, i32* %5
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %4
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 %18, i8* %22
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %11
25: ; preds = %11
br label %26
26: ; preds = %25, %2
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @createsequence(i32* %0, i8* nocapture writeonly %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = tail call i32 @fgetc(i32* %0)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %17, label %8
8: ; preds = %4, %8
%9 = phi i64 [ %13, %8 ], [ 0, %4 ]
%10 = phi i32 [ %14, %8 ], [ %5, %4 ]
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 %11, i8* %12
%13 = add nuw i64 %9, 1
%14 = tail call i32 @fgetc(i32* %0)
%15 = load i32, i32* @EOF
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %4, %2
ret void
}