#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void dumpSeq(FILE *outFD, char *seqname, char *sequence, int offset, int len) {
  fprintf(outFD, "%s\n", seqname);
  sequence = sequence + offset;
  while (len > 50) {
    fwrite(sequence, sizeof(char), 50, outFD);
    fprintf(outFD, "\n");
    sequence += 50;
    len -= 50;
  }
  if (len > 0) {
    fwrite(sequence, sizeof(char), len, outFD);
    fprintf(outFD, "\n");
  }
}


x86 assembly (clang, -O0):
<dumpSeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x32,-0x20(%rbp)
jle    11ad <dumpSeq+0x8d>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x32,%edx
call   1040 <fwrite@plt>
mov    -0x8(%rbp),%rdi
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x32,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
sub    $0x32,%eax
mov    %eax,-0x20(%rbp)
jmp    1160 <dumpSeq+0x40>
cmpl   $0x0,-0x20(%rbp)
jle    11de <dumpSeq+0xbe>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    -0x8(%rbp),%rdi
lea    0xe2b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpSeq>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r12d
mov    %ecx,%ebx
mov    %rdx,%r15
mov    %rsi,%rdx
mov    %rdi,%r14
lea    0xec3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
movslq %ebx,%rbx
add    %r15,%rbx
cmp    $0x33,%r12d
jl     119c <dumpSeq+0x7c>
lea    0xeab(%rip),%r15
mov    %r12d,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x32,%edx
mov    %r14,%rcx
call   1040 <fwrite@plt>
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   1040 <fwrite@plt>
add    $0x32,%rbx
lea    -0x32(%rbp),%r12d
cmp    $0x64,%ebp
mov    %r12d,%ebp
ja     1160 <dumpSeq+0x40>
jmp    11a1 <dumpSeq+0x81>
test   %r12d,%r12d
jle    11d5 <dumpSeq+0xb5>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    %r14,%rcx
call   1040 <fwrite@plt>
lea    0xe47(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fwrite@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @dumpSeq(i32* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8* %17, i8** %8
br label %18
18: ; preds = %21, %5
%19 = load i32, i32* %10
%20 = icmp sgt i32 %19, 50
br i1 %20, label %21, label %31
21: ; preds = %18
%22 = load i8*, i8** %8
%23 = load i32*, i32** %6
%24 = call i32 @fwrite(i8* %22, i32 1, i32 50, i32* %23)
%25 = load i32*, i32** %6
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%27 = load i8*, i8** %8
%28 = getelementptr inbounds i8, i8* %27, i64 50
store i8* %28, i8** %8
%29 = load i32, i32* %10
%30 = sub nsw i32 %29, 50
store i32 %30, i32* %10
br label %18
31: ; preds = %18
%32 = load i32, i32* %10
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %41
34: ; preds = %31
%35 = load i8*, i8** %8
%36 = load i32, i32* %10
%37 = load i32*, i32** %6
%38 = call i32 @fwrite(i8* %35, i32 1, i32 %36, i32* %37)
%39 = load i32*, i32** %6
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %41
41: ; preds = %34, %31
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @dumpSeq(i32* %0, i8* %1, i8* nocapture %2, i32 %3, i32 %4) {
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
%9 = icmp sgt i32 %4, 50
br i1 %9, label %10, label %18
10: ; preds = %5, %10
%11 = phi i32 [ %16, %10 ], [ %4, %5 ]
%12 = phi i8* [ %15, %10 ], [ %8, %5 ]
%13 = tail call i32 @fwrite(i8* %12, i32 1, i32 50, i32* %0)
%14 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i64 1, i64 1, i32* %0)
%15 = getelementptr inbounds i8, i8* %12, i64 50
%16 = add nsw i32 %11, -50
%17 = icmp ugt i32 %11, 100
br i1 %17, label %10, label %20
18: ; preds = %5
%19 = icmp sgt i32 %4, 0
br i1 %19, label %20, label %25
20: ; preds = %10, %18
%21 = phi i32 [ %4, %18 ], [ %16, %10 ]
%22 = phi i8* [ %8, %18 ], [ %15, %10 ]
%23 = tail call i32 @fwrite(i8* %22, i32 1, i32 %21, i32* %0)
%24 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i64 1, i64 1, i32* %0)
br label %25
25: ; preds = %20, %18
ret void
}