#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 */
scalar_t__ vrna_realloc(char **, int);
void endmarker_msa_record(char ***names, char ***aln, int seq_num) {
  if (seq_num > 0) {
    (*aln) = (char **)vrna_realloc(*aln, sizeof(char *) * (seq_num + 1));
    (*names) = (char **)vrna_realloc(*names, sizeof(char *) * (seq_num + 1));
    (*aln)[seq_num] = NULL;
    (*names)[seq_num] = NULL;
  }
}


x86 assembly (clang, -O0):
<endmarker_msa_record>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    119b <endmarker_msa_record+0x8b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%esi
call   1030 <vrna_realloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%esi
call   1030 <vrna_realloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endmarker_msa_record>:
test   %edx,%edx
jle    1166 <endmarker_msa_record+0x56>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r15
mov    %rdi,%r14
mov    (%rsi),%rdi
lea    0x8(,%rbx,8),%ebp
mov    %ebp,%esi
call   1030 <vrna_realloc@plt>
mov    %rax,(%r15)
mov    (%r14),%rdi
mov    %ebp,%esi
call   1030 <vrna_realloc@plt>
mov    %rax,(%r14)
mov    (%r15),%rax
mov    %ebx,%ecx
movq   $0x0,(%rax,%rcx,8)
mov    (%r14),%rax
movq   $0x0,(%rax,%rcx,8)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @endmarker_msa_record(i8*** nocapture %0, i8*** nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = load i8**, i8*** %1
%7 = shl i32 %2, 3
%8 = add i32 %7, 8
%9 = tail call i64 @vrna_realloc(i8** %6, i32 %8)
%10 = inttoptr i64 %9 to i8**
store i8** %10, i8*** %1
%11 = load i8**, i8*** %0
%12 = tail call i64 @vrna_realloc(i8** %11, i32 %8)
%13 = inttoptr i64 %12 to i8**
store i8** %13, i8*** %0
%14 = load i8**, i8*** %1
%15 = zext i32 %2 to i64
%16 = getelementptr inbounds i8*, i8** %14, i64 %15
store i8* null, i8** %16
%17 = load i8**, i8*** %0
%18 = getelementptr inbounds i8*, i8** %17, i64 %15
store i8* null, i8** %18
br label %19
19: ; preds = %5, %3
ret void
}