#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 */
char **malloc(int);
char *transfer_gaps(char *, char *, char, char);
char **transfer_gaps_multi(int n_seqs, char *gapped_seqs[], char *inseqs[],
                           char gap_char1, char gap_char2) {
  char **outseqs = malloc(sizeof(char *) * n_seqs);
  int i;
  for (i = 0; i < n_seqs; i++) {
    outseqs[i] = transfer_gaps(gapped_seqs[i], inseqs[i], gap_char1, gap_char2);
  }
  return outseqs;
}


x86 assembly (clang, -O0):
<transfer_gaps_multi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8b,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %cl,-0x19(%rbp)
mov    %al,-0x1a(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11a6 <transfer_gaps_multi+0x86>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x19(%rbp),%al
movsbl %al,%edx
movsbl -0x1a(%rbp),%ecx
call   1030 <transfer_gaps@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1156 <transfer_gaps_multi+0x36>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_gaps_multi>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %ecx,%ebp
mov    %rdx,(%rsp)
mov    %rsi,%r15
mov    %edi,%ebx
lea    0x0(,%rbx,8),%edi
call   1040 <malloc@plt>
mov    %rax,%r13
test   %ebx,%ebx
jle    1183 <transfer_gaps_multi+0x63>
mov    %ebx,%r12d
mov    %r14d,%eax
xor    %r14d,%r14d
movsbl %bpl,%ebp
movsbl %al,%ebx
nopl   0x0(%rax)
mov    (%r15,%r14,8),%rdi
mov    (%rsp),%rax
mov    (%rax,%r14,8),%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1030 <transfer_gaps@plt>
mov    %rax,0x0(%r13,%r14,8)
add    $0x1,%r14
cmp    %r14,%r12
jne    1160 <transfer_gaps_multi+0x40>
mov    %r13,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8** @transfer_gaps_multi(i32 %0, i8** %1, i8** %2, i8 signext %3, i8 signext %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8**
%12 = alloca i32
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8** %2, i8*** %8
store i8 %3, i8* %9
store i8 %4, i8* %10
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = mul i64 8, %14
%16 = trunc i64 %15 to i32
%17 = call i8** @malloc(i32 %16)
store i8** %17, i8*** %11
store i32 0, i32* %12
br label %18
18: ; preds = %40, %5
%19 = load i32, i32* %12
%20 = load i32, i32* %6
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %43
22: ; preds = %18
%23 = load i8**, i8*** %7
%24 = load i32, i32* %12
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = load i8**, i8*** %8
%29 = load i32, i32* %12
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8*, i8** %28, i64 %30
%32 = load i8*, i8** %31
%33 = load i8, i8* %9
%34 = load i8, i8* %10
%35 = call i8* @transfer_gaps(i8* %27, i8* %32, i8 signext %33, i8 signext %34)
%36 = load i8**, i8*** %11
%37 = load i32, i32* %12
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %36, i64 %38
store i8* %35, i8** %39
br label %40
40: ; preds = %22
%41 = load i32, i32* %12
%42 = add nsw i32 %41, 1
store i32 %42, i32* %12
br label %18
43: ; preds = %18
%44 = load i8**, i8*** %11
ret i8** %44
}

LLVM IR (-O2):
define noalias i8** @transfer_gaps_multi(i32 %0, i8** nocapture %1, i8** nocapture %2, i8 signext %3, i8 signext %4) {
%6 = shl i32 %0, 3
%7 = tail call i8** @malloc(i32 %6)
%8 = icmp sgt i32 %0, 0
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 0, %9 ], [ %19, %11 ]
%13 = getelementptr inbounds i8*, i8** %1, i64 %12
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8*, i8** %2, i64 %12
%16 = load i8*, i8** %15
%17 = tail call i8* @transfer_gaps(i8* %14, i8* %16, i8 signext %3, i8 signext %4)
%18 = getelementptr inbounds i8*, i8** %7, i64 %12
store i8* %17, i8** %18
%19 = add nuw nsw i64 %12, 1
%20 = icmp eq i64 %19, %10
br i1 %20, label %21, label %11
21: ; preds = %11, %5
ret i8** %7
}