#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*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ int_ok(char, char);
int /*<<< orphan*/ size_ok(size_t, int);
size_t snpack(char *, int, char *, char *, ...);
int /*<<< orphan*/ test(char *);
int /*<<< orphan*/ title(char *);
int main(void) {
  char buffer[20];
  size_t len;
  title("snpack()");
  test("u8[5]");
  len = snpack(buffer, sizeof(buffer), "u8[5]", "Hello");
  size_ok(len, 5);
  int_ok(buffer[0], 'H');
  int_ok(buffer[1], 'e');
  int_ok(buffer[2], 'l');
  int_ok(buffer[3], 'l');
  int_ok(buffer[4], 'o');
  test("u8[] with 3");
  len = snpack(buffer, sizeof(buffer), "u8[]", "Hi", 3);
  size_ok(len, 3);
  int_ok(buffer[0], 'H');
  int_ok(buffer[1], 'i');
  int_ok(buffer[2], 0);
  test("u8[u8] with 0");
  len = snpack(buffer, sizeof(buffer), "u8[u8]", "", 0);
  size_ok(len, 1);
  int_ok(buffer[0], 0);
  test("u8[u8] with 4");
  len = snpack(buffer, sizeof(buffer), "u8[u8]", "1234", 4);
  size_ok(len, 5);
  int_ok(buffer[0], 4);
  int_ok(buffer[1], '1');
  int_ok(buffer[2], '2');
  int_ok(buffer[3], '3');
  int_ok(buffer[4], '4');
  test("u8[u32<] with 0");
  len = snpack(buffer, sizeof(buffer), "u8[u32<]", "", 0);
  size_ok(len, 4);
  int_ok(buffer[0], 0);
  int_ok(buffer[1], 0);
  int_ok(buffer[2], 0);
  int_ok(buffer[3], 0);
  test("u8[u32<] with 4");
  len = snpack(buffer, sizeof(buffer), "u8[u32<]", "1234", 4);
  size_ok(len, 8);
  int_ok(buffer[0], 4);
  int_ok(buffer[1], 0);
  int_ok(buffer[2], 0);
  int_ok(buffer[3], 0);
  int_ok(buffer[4], '1');
  int_ok(buffer[5], '2');
  int_ok(buffer[6], '3');
  int_ok(buffer[7], '4');
  test("u8[5] count");
  len = snpack(NULL, 0, "u8[5]", "Hello");
  size_ok(len, 5);
  test("u8[] with 3 count");
  len = snpack(NULL, 0, "u8[]", "Hi", 3);
  size_ok(len, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xea1(%rip),%rdi
call   1050 <title@plt>
lea    0xe9e(%rip),%rdi
call   1070 <test@plt>
lea    -0x20(%rbp),%rdi
mov    $0x14,%esi
lea    0xe89(%rip),%rdx
lea    0xe88(%rip),%rcx
mov    $0x0,%al
call   1040 <snpack@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x5,%esi
call   1060 <size_ok@plt>
mov    $0x48,%esi
movsbl -0x20(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x65,%esi
movsbl -0x1f(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x6c,%esi
movsbl -0x1e(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x6c,%esi
movsbl -0x1d(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x6f,%esi
movsbl -0x1c(%rbp),%edi
call   1030 <int_ok@plt>
lea    0xe28(%rip),%rdi
call   1070 <test@plt>
lea    -0x20(%rbp),%rdi
mov    $0x14,%esi
lea    0xe1f(%rip),%rdx
lea    0xe1d(%rip),%rcx
mov    $0x3,%r8d
mov    $0x0,%al
call   1040 <snpack@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x3,%esi
call   1060 <size_ok@plt>
mov    $0x48,%esi
movsbl -0x20(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x69,%esi
movsbl -0x1f(%rbp),%edi
call   1030 <int_ok@plt>
xor    %esi,%esi
movsbl -0x1e(%rbp),%edi
call   1030 <int_ok@plt>
lea    0xdd3(%rip),%rdi
call   1070 <test@plt>
lea    -0x20(%rbp),%rdi
mov    $0x14,%esi
lea    0xdcc(%rip),%rdx
lea    0xd96(%rip),%rcx
xor    %r8d,%r8d
mov    $0x0,%al
call   1040 <snpack@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
call   1060 <size_ok@plt>
xor    %esi,%esi
movsbl -0x20(%rbp),%edi
call   1030 <int_ok@plt>
lea    0xd9e(%rip),%rdi
call   1070 <test@plt>
lea    -0x20(%rbp),%rdi
mov    $0x14,%esi
lea    0xd82(%rip),%rdx
lea    0xd90(%rip),%rcx
mov    $0x4,%r8d
mov    $0x0,%al
call   1040 <snpack@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x5,%esi
call   1060 <size_ok@plt>
mov    $0x4,%esi
movsbl -0x20(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x31,%esi
movsbl -0x1f(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x32,%esi
movsbl -0x1e(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x33,%esi
movsbl -0x1d(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x34,%esi
movsbl -0x1c(%rbp),%edi
call   1030 <int_ok@plt>
lea    0xd29(%rip),%rdi
call   1070 <test@plt>
lea    -0x20(%rbp),%rdi
mov    $0x14,%esi
lea    0xd24(%rip),%rdx
lea    0xcc4(%rip),%rcx
xor    %r8d,%r8d
mov    $0x0,%al
call   1040 <snpack@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x4,%esi
call   1060 <size_ok@plt>
xor    %esi,%esi
movsbl -0x20(%rbp),%edi
call   1030 <int_ok@plt>
xor    %esi,%esi
movsbl -0x1f(%rbp),%edi
call   1030 <int_ok@plt>
xor    %esi,%esi
movsbl -0x1e(%rbp),%edi
call   1030 <int_ok@plt>
xor    %esi,%esi
movsbl -0x1d(%rbp),%edi
call   1030 <int_ok@plt>
lea    0xcd7(%rip),%rdi
call   1070 <test@plt>
lea    -0x20(%rbp),%rdi
mov    $0x14,%esi
lea    0xcb9(%rip),%rdx
lea    0xc9d(%rip),%rcx
mov    $0x4,%r8d
mov    $0x0,%al
call   1040 <snpack@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x8,%esi
call   1060 <size_ok@plt>
mov    $0x4,%esi
movsbl -0x20(%rbp),%edi
call   1030 <int_ok@plt>
xor    %esi,%esi
movsbl -0x1f(%rbp),%edi
call   1030 <int_ok@plt>
xor    %esi,%esi
movsbl -0x1e(%rbp),%edi
call   1030 <int_ok@plt>
xor    %esi,%esi
movsbl -0x1d(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x31,%esi
movsbl -0x1c(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x32,%esi
movsbl -0x1b(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x33,%esi
movsbl -0x1a(%rbp),%edi
call   1030 <int_ok@plt>
mov    $0x34,%esi
movsbl -0x19(%rbp),%edi
call   1030 <int_ok@plt>
lea    0xc3e(%rip),%rdi
call   1070 <test@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xbbb(%rip),%rdx
lea    0xbba(%rip),%rcx
mov    $0x0,%al
call   1040 <snpack@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x5,%esi
call   1060 <size_ok@plt>
lea    0xc11(%rip),%rdi
call   1070 <test@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xb9a(%rip),%rdx
lea    0xb98(%rip),%rcx
mov    $0x3,%r8d
mov    $0x0,%al
call   1040 <snpack@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x3,%esi
call   1060 <size_ok@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe9b(%rip),%rdi
call   1050 <title@plt>
lea    0xe98(%rip),%r13
mov    %r13,%rdi
call   1070 <test@plt>
lea    0xe8f(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <snpack@plt>
mov    %rax,%rdi
mov    $0x5,%esi
call   1060 <size_ok@plt>
movsbl (%rsp),%edi
mov    $0x48,%esi
call   1030 <int_ok@plt>
movsbl 0x1(%rsp),%edi
mov    $0x65,%esi
call   1030 <int_ok@plt>
movsbl 0x2(%rsp),%edi
mov    $0x6c,%esi
call   1030 <int_ok@plt>
movsbl 0x3(%rsp),%edi
mov    $0x6c,%esi
call   1030 <int_ok@plt>
movsbl 0x4(%rsp),%edi
mov    $0x6f,%esi
call   1030 <int_ok@plt>
lea    0xe22(%rip),%rdi
call   1070 <test@plt>
lea    0xe22(%rip),%rdx
lea    0xe20(%rip),%rcx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    $0x3,%r8d
xor    %eax,%eax
call   1040 <snpack@plt>
mov    %rax,%rdi
mov    $0x3,%esi
call   1060 <size_ok@plt>
movsbl (%rsp),%edi
mov    $0x48,%esi
call   1030 <int_ok@plt>
movsbl 0x1(%rsp),%edi
mov    $0x69,%esi
call   1030 <int_ok@plt>
movsbl 0x2(%rsp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
lea    0xdd1(%rip),%rdi
call   1070 <test@plt>
lea    0xdd3(%rip),%rbp
lea    0xd9d(%rip),%r14
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %rbp,%rdx
mov    %r14,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1040 <snpack@plt>
mov    %rax,%rdi
mov    $0x1,%esi
call   1060 <size_ok@plt>
movsbl (%rsp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
lea    0xd9c(%rip),%rdi
call   1070 <test@plt>
lea    0xd9e(%rip),%r12
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %rbp,%rdx
mov    %r12,%rcx
mov    $0x4,%r8d
xor    %eax,%eax
call   1040 <snpack@plt>
mov    %rax,%rdi
mov    $0x5,%esi
call   1060 <size_ok@plt>
movsbl (%rsp),%edi
mov    $0x4,%esi
call   1030 <int_ok@plt>
movsbl 0x1(%rsp),%edi
mov    $0x31,%esi
call   1030 <int_ok@plt>
movsbl 0x2(%rsp),%edi
mov    $0x32,%esi
call   1030 <int_ok@plt>
movsbl 0x3(%rsp),%edi
mov    $0x33,%esi
call   1030 <int_ok@plt>
movsbl 0x4(%rsp),%edi
mov    $0x34,%esi
call   1030 <int_ok@plt>
lea    0xd2a(%rip),%rdi
call   1070 <test@plt>
lea    0xd2e(%rip),%r15
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1040 <snpack@plt>
mov    %rax,%rdi
mov    $0x4,%esi
call   1060 <size_ok@plt>
movsbl (%rsp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
movsbl 0x1(%rsp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
movsbl 0x2(%rsp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
movsbl 0x3(%rsp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
lea    0xcdc(%rip),%rdi
call   1070 <test@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %r15,%rdx
mov    %r12,%rcx
mov    $0x4,%r8d
xor    %eax,%eax
call   1040 <snpack@plt>
mov    %rax,%rdi
mov    $0x8,%esi
call   1060 <size_ok@plt>
movsbl (%rsp),%edi
mov    $0x4,%esi
call   1030 <int_ok@plt>
movsbl 0x1(%rsp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
movsbl 0x2(%rsp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
movsbl 0x3(%rsp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
movsbl 0x4(%rsp),%edi
mov    $0x31,%esi
call   1030 <int_ok@plt>
movsbl 0x5(%rsp),%edi
mov    $0x32,%esi
call   1030 <int_ok@plt>
movsbl 0x6(%rsp),%edi
mov    $0x33,%esi
call   1030 <int_ok@plt>
movsbl 0x7(%rsp),%edi
mov    $0x34,%esi
call   1030 <int_ok@plt>
lea    0xc4a(%rip),%rdi
call   1070 <test@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r13,%rdx
lea    0xbcc(%rip),%rcx
xor    %eax,%eax
call   1040 <snpack@plt>
mov    %rax,%rdi
mov    $0x5,%esi
call   1060 <size_ok@plt>
lea    0xc28(%rip),%rdi
call   1070 <test@plt>
xor    %edi,%edi
xor    %esi,%esi
lea    0xbb3(%rip),%rdx
lea    0xbb1(%rip),%rcx
mov    $0x3,%r8d
xor    %eax,%eax
call   1040 <snpack@plt>
mov    %rax,%rdi
mov    $0x3,%esi
call   1060 <size_ok@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"snpack()\00"
@.str.1 = [6 x i8] c"u8[5]\00"
@.str.2 = [6 x i8] c"Hello\00"
@.str.3 = [12 x i8] c"u8[] with 3\00"
@.str.4 = [5 x i8] c"u8[]\00"
@.str.5 = [3 x i8] c"Hi\00"
@.str.6 = [14 x i8] c"u8[u8] with 0\00"
@.str.7 = [7 x i8] c"u8[u8]\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [14 x i8] c"u8[u8] with 4\00"
@.str.10 = [5 x i8] c"1234\00"
@.str.11 = [16 x i8] c"u8[u32<] with 0\00"
@.str.12 = [9 x i8] c"u8[u32<]\00"
@.str.13 = [16 x i8] c"u8[u32<] with 4\00"
@.str.14 = [12 x i8] c"u8[5] count\00"
@.str.15 = [18 x i8] c"u8[] with 3 count\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca i64
%3 = call i32 @title(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* %5, i32 20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = call i32 @size_ok(i64 %7, i32 5)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%10 = load i8, i8* %9
%11 = call i32 @int_ok(i8 signext %10, i8 signext 72)
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 1
%13 = load i8, i8* %12
%14 = call i32 @int_ok(i8 signext %13, i8 signext 101)
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
%16 = load i8, i8* %15
%17 = call i32 @int_ok(i8 signext %16, i8 signext 108)
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 3
%19 = load i8, i8* %18
%20 = call i32 @int_ok(i8 signext %19, i8 signext 108)
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 4
%22 = load i8, i8* %21
%23 = call i32 @int_ok(i8 signext %22, i8 signext 111)
%24 = call i32 @test(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%25 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%26 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* %25, i32 20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 3)
store i64 %26, i64* %2
%27 = load i64, i64* %2
%28 = call i32 @size_ok(i64 %27, i32 3)
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%30 = load i8, i8* %29
%31 = call i32 @int_ok(i8 signext %30, i8 signext 72)
%32 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 1
%33 = load i8, i8* %32
%34 = call i32 @int_ok(i8 signext %33, i8 signext 105)
%35 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
%36 = load i8, i8* %35
%37 = call i32 @int_ok(i8 signext %36, i8 signext 0)
%38 = call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%39 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%40 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* %39, i32 20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i32 0)
store i64 %40, i64* %2
%41 = load i64, i64* %2
%42 = call i32 @size_ok(i64 %41, i32 1)
%43 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%44 = load i8, i8* %43
%45 = call i32 @int_ok(i8 signext %44, i8 signext 0)
%46 = call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%47 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%48 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* %47, i32 20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
store i64 %48, i64* %2
%49 = load i64, i64* %2
%50 = call i32 @size_ok(i64 %49, i32 5)
%51 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%52 = load i8, i8* %51
%53 = call i32 @int_ok(i8 signext %52, i8 signext 4)
%54 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 1
%55 = load i8, i8* %54
%56 = call i32 @int_ok(i8 signext %55, i8 signext 49)
%57 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
%58 = load i8, i8* %57
%59 = call i32 @int_ok(i8 signext %58, i8 signext 50)
%60 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 3
%61 = load i8, i8* %60
%62 = call i32 @int_ok(i8 signext %61, i8 signext 51)
%63 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 4
%64 = load i8, i8* %63
%65 = call i32 @int_ok(i8 signext %64, i8 signext 52)
%66 = call i32 @test(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
%67 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%68 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* %67, i32 20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i32 0)
store i64 %68, i64* %2
%69 = load i64, i64* %2
%70 = call i32 @size_ok(i64 %69, i32 4)
%71 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%72 = load i8, i8* %71
%73 = call i32 @int_ok(i8 signext %72, i8 signext 0)
%74 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 1
%75 = load i8, i8* %74
%76 = call i32 @int_ok(i8 signext %75, i8 signext 0)
%77 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
%78 = load i8, i8* %77
%79 = call i32 @int_ok(i8 signext %78, i8 signext 0)
%80 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 3
%81 = load i8, i8* %80
%82 = call i32 @int_ok(i8 signext %81, i8 signext 0)
%83 = call i32 @test(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0))
%84 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%85 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* %84, i32 20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
store i64 %85, i64* %2
%86 = load i64, i64* %2
%87 = call i32 @size_ok(i64 %86, i32 8)
%88 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%89 = load i8, i8* %88
%90 = call i32 @int_ok(i8 signext %89, i8 signext 4)
%91 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 1
%92 = load i8, i8* %91
%93 = call i32 @int_ok(i8 signext %92, i8 signext 0)
%94 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
%95 = load i8, i8* %94
%96 = call i32 @int_ok(i8 signext %95, i8 signext 0)
%97 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 3
%98 = load i8, i8* %97
%99 = call i32 @int_ok(i8 signext %98, i8 signext 0)
%100 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 4
%101 = load i8, i8* %100
%102 = call i32 @int_ok(i8 signext %101, i8 signext 49)
%103 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 5
%104 = load i8, i8* %103
%105 = call i32 @int_ok(i8 signext %104, i8 signext 50)
%106 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 6
%107 = load i8, i8* %106
%108 = call i32 @int_ok(i8 signext %107, i8 signext 51)
%109 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 7
%110 = load i8, i8* %109
%111 = call i32 @int_ok(i8 signext %110, i8 signext 52)
%112 = call i32 @test(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0))
%113 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* null, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i64 %113, i64* %2
%114 = load i64, i64* %2
%115 = call i32 @size_ok(i64 %114, i32 5)
%116 = call i32 @test(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0))
%117 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* null, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 3)
store i64 %117, i64* %2
%118 = load i64, i64* %2
%119 = call i32 @size_ok(i64 %118, i32 3)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"snpack()\00"
@.str.1 = [6 x i8] c"u8[5]\00"
@.str.2 = [6 x i8] c"Hello\00"
@.str.3 = [12 x i8] c"u8[] with 3\00"
@.str.4 = [5 x i8] c"u8[]\00"
@.str.5 = [3 x i8] c"Hi\00"
@.str.6 = [14 x i8] c"u8[u8] with 0\00"
@.str.7 = [7 x i8] c"u8[u8]\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [14 x i8] c"u8[u8] with 4\00"
@.str.10 = [5 x i8] c"1234\00"
@.str.11 = [16 x i8] c"u8[u32<] with 0\00"
@.str.12 = [9 x i8] c"u8[u32<]\00"
@.str.13 = [16 x i8] c"u8[u32<] with 4\00"
@.str.14 = [12 x i8] c"u8[5] count\00"
@.str.15 = [18 x i8] c"u8[] with 3 count\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @title(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* %2, i32 20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @size_ok(i64 %5, i32 5)
%7 = load i8, i8* %2
%8 = call i32 @int_ok(i8 signext %7, i8 signext 72)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 1
%10 = load i8, i8* %9
%11 = call i32 @int_ok(i8 signext %10, i8 signext 101)
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
%13 = load i8, i8* %12
%14 = call i32 @int_ok(i8 signext %13, i8 signext 108)
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 3
%16 = load i8, i8* %15
%17 = call i32 @int_ok(i8 signext %16, i8 signext 108)
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 4
%19 = load i8, i8* %18
%20 = call i32 @int_ok(i8 signext %19, i8 signext 111)
%21 = call i32 @test(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%22 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* %2, i32 20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 3)
%23 = call i32 @size_ok(i64 %22, i32 3)
%24 = load i8, i8* %2
%25 = call i32 @int_ok(i8 signext %24, i8 signext 72)
%26 = load i8, i8* %9
%27 = call i32 @int_ok(i8 signext %26, i8 signext 105)
%28 = load i8, i8* %12
%29 = call i32 @int_ok(i8 signext %28, i8 signext 0)
%30 = call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%31 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* %2, i32 20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i32 0)
%32 = call i32 @size_ok(i64 %31, i32 1)
%33 = load i8, i8* %2
%34 = call i32 @int_ok(i8 signext %33, i8 signext 0)
%35 = call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%36 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* %2, i32 20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%37 = call i32 @size_ok(i64 %36, i32 5)
%38 = load i8, i8* %2
%39 = call i32 @int_ok(i8 signext %38, i8 signext 4)
%40 = load i8, i8* %9
%41 = call i32 @int_ok(i8 signext %40, i8 signext 49)
%42 = load i8, i8* %12
%43 = call i32 @int_ok(i8 signext %42, i8 signext 50)
%44 = load i8, i8* %15
%45 = call i32 @int_ok(i8 signext %44, i8 signext 51)
%46 = load i8, i8* %18
%47 = call i32 @int_ok(i8 signext %46, i8 signext 52)
%48 = call i32 @test(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
%49 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* %2, i32 20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i32 0)
%50 = call i32 @size_ok(i64 %49, i32 4)
%51 = load i8, i8* %2
%52 = call i32 @int_ok(i8 signext %51, i8 signext 0)
%53 = load i8, i8* %9
%54 = call i32 @int_ok(i8 signext %53, i8 signext 0)
%55 = load i8, i8* %12
%56 = call i32 @int_ok(i8 signext %55, i8 signext 0)
%57 = load i8, i8* %15
%58 = call i32 @int_ok(i8 signext %57, i8 signext 0)
%59 = call i32 @test(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0))
%60 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* %2, i32 20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%61 = call i32 @size_ok(i64 %60, i32 8)
%62 = load i8, i8* %2
%63 = call i32 @int_ok(i8 signext %62, i8 signext 4)
%64 = load i8, i8* %9
%65 = call i32 @int_ok(i8 signext %64, i8 signext 0)
%66 = load i8, i8* %12
%67 = call i32 @int_ok(i8 signext %66, i8 signext 0)
%68 = load i8, i8* %15
%69 = call i32 @int_ok(i8 signext %68, i8 signext 0)
%70 = load i8, i8* %18
%71 = call i32 @int_ok(i8 signext %70, i8 signext 49)
%72 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 5
%73 = load i8, i8* %72
%74 = call i32 @int_ok(i8 signext %73, i8 signext 50)
%75 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 6
%76 = load i8, i8* %75
%77 = call i32 @int_ok(i8 signext %76, i8 signext 51)
%78 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 7
%79 = load i8, i8* %78
%80 = call i32 @int_ok(i8 signext %79, i8 signext 52)
%81 = call i32 @test(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0))
%82 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* null, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%83 = call i32 @size_ok(i64 %82, i32 5)
%84 = call i32 @test(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0))
%85 = call i64 (i8*, i32, i8*, i8*, ...) @snpack(i8* null, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 3)
%86 = call i32 @size_ok(i64 %85, i32 3)
ret i32 0
}