#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 *strdup(char const *);
scalar_t__ vrna_realloc(char **, int);
void add_sequence(const char *id, const char *seq, char ***names, char ***aln,
                  int seq_num) {
  (*names) = (char **)vrna_realloc(*names, sizeof(char *) * (seq_num));
  (*names)[seq_num - 1] = strdup(id);
  (*aln) = (char **)vrna_realloc(*aln, sizeof(char *) * (seq_num));
  (*aln)[seq_num - 1] = strdup(seq);
}


x86 assembly (clang, -O0):
<add_sequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
call   1030 <vrna_realloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
call   1030 <vrna_realloc@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_sequence>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%r15d
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,(%rsp)
mov    %rdi,%rbp
mov    (%rdx),%rdi
lea    0x0(,%r15,8),%r13d
mov    %r13d,%esi
call   1030 <vrna_realloc@plt>
mov    %rax,%r12
mov    %rax,(%rbx)
mov    %rbp,%rdi
call   1040 <strdup@plt>
movslq %r15d,%rbp
mov    %rax,-0x8(%r12,%rbp,8)
mov    (%r14),%rdi
mov    %r13d,%esi
call   1030 <vrna_realloc@plt>
mov    %rax,%rbx
mov    %rax,(%r14)
mov    (%rsp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbx,%rbp,8)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @add_sequence(i8* %0, i8* %1, i8*** %2, i8*** %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8***
%9 = alloca i8***
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8*** %2, i8**** %8
store i8*** %3, i8**** %9
store i32 %4, i32* %10
%11 = load i8***, i8**** %8
%12 = load i8**, i8*** %11
%13 = load i32, i32* %10
%14 = sext i32 %13 to i64
%15 = mul i64 8, %14
%16 = trunc i64 %15 to i32
%17 = call i64 @vrna_realloc(i8** %12, i32 %16)
%18 = inttoptr i64 %17 to i8**
%19 = load i8***, i8**** %8
store i8** %18, i8*** %19
%20 = load i8*, i8** %6
%21 = call i8* @strdup(i8* %20)
%22 = load i8***, i8**** %8
%23 = load i8**, i8*** %22
%24 = load i32, i32* %10
%25 = sub nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %23, i64 %26
store i8* %21, i8** %27
%28 = load i8***, i8**** %9
%29 = load i8**, i8*** %28
%30 = load i32, i32* %10
%31 = sext i32 %30 to i64
%32 = mul i64 8, %31
%33 = trunc i64 %32 to i32
%34 = call i64 @vrna_realloc(i8** %29, i32 %33)
%35 = inttoptr i64 %34 to i8**
%36 = load i8***, i8**** %9
store i8** %35, i8*** %36
%37 = load i8*, i8** %7
%38 = call i8* @strdup(i8* %37)
%39 = load i8***, i8**** %9
%40 = load i8**, i8*** %39
%41 = load i32, i32* %10
%42 = sub nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %40, i64 %43
store i8* %38, i8** %44
ret void
}

LLVM IR (-O2):
define void @add_sequence(i8* nocapture %0, i8* nocapture %1, i8*** nocapture %2, i8*** nocapture %3, i32 %4) {
%6 = load i8**, i8*** %2
%7 = shl i32 %4, 3
%8 = tail call i64 @vrna_realloc(i8** %6, i32 %7)
%9 = inttoptr i64 %8 to i8**
store i8** %9, i8*** %2
%10 = tail call i8* @strdup(i8* %0)
%11 = add nsw i32 %4, -1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %9, i64 %12
store i8* %10, i8** %13
%14 = load i8**, i8*** %3
%15 = tail call i64 @vrna_realloc(i8** %14, i32 %7)
%16 = inttoptr i64 %15 to i8**
store i8** %16, i8*** %3
%17 = tail call i8* @strdup(i8* %1)
%18 = getelementptr inbounds i8*, i8** %16, i64 %12
store i8* %17, i8** %18
ret void
}