#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 fget_int(int /*<<< orphan*/ *);
long fget_long(int /*<<< orphan*/ *);
int fget_short(int /*<<< orphan*/ *);
size_t fpack(int /*<<< orphan*/ *, char *, long, ...);
int /*<<< orphan*/ fput_int(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fput_long(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fput_short(int, int /*<<< orphan*/ *);
size_t funpack(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ int_ok(int, int);
int /*<<< orphan*/ long_ok(long, int);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ size_ok(size_t, int);
int /*<<< orphan*/ test(char *);
int /*<<< orphan*/ title(char *);
int /*<<< orphan*/ *tmpfile();
int main(void) {
  FILE *file = tmpfile();
  size_t len;
  title("fpack()");
  test("s");
  rewind(file);
  len = fpack(file, "s", 0);
  size_ok(len, 1 * sizeof(short));
  rewind(file);
  int_ok(fget_short(file), 0);
  test("ss");
  rewind(file);
  len = fpack(file, "ss", 1, 2);
  size_ok(len, 2 * sizeof(short));
  rewind(file);
  int_ok(fget_short(file), 1);
  int_ok(fget_short(file), 2);
  test("i");
  rewind(file);
  len = fpack(file, "i", 0);
  size_ok(len, 1 * sizeof(int));
  rewind(file);
  int_ok(fget_int(file), 0);
  test("ii");
  rewind(file);
  len = fpack(file, "ii", 1, 2);
  size_ok(len, 2 * sizeof(int));
  rewind(file);
  int_ok(fget_int(file), 1);
  int_ok(fget_int(file), 2);
  test("l");
  rewind(file);
  len = fpack(file, "l", 0L);
  long_ok(len, 1 * sizeof(long));
  rewind(file);
  long_ok(fget_long(file), 0);
  test("ll");
  rewind(file);
  len = fpack(file, "ll", 1L, 2L);
  long_ok(len, 2 * sizeof(long));
  rewind(file);
  long_ok(fget_long(file), 1);
  long_ok(fget_long(file), 2);
  title("funpack()");
  short s1, s2;
  test("s");
  rewind(file);
  fput_short(0, file);
  rewind(file);
  len = funpack(file, "s", &s1);
  size_ok(len, 1 * sizeof(short));
  int_ok(s1, 0);
  test("ss");
  rewind(file);
  fput_short(1, file);
  fput_short(2, file);
  rewind(file);
  len = funpack(file, "ss", &s1, &s2);
  size_ok(len, 2 * sizeof(short));
  int_ok(s1, 1);
  int_ok(s2, 2);
  int i1, i2;
  test("i");
  rewind(file);
  fput_int(0, file);
  rewind(file);
  len = funpack(file, "i", &i1);
  size_ok(len, 1 * sizeof(int));
  int_ok(i1, 0);
  test("ii");
  rewind(file);
  fput_int(1, file);
  fput_int(2, file);
  rewind(file);
  len = funpack(file, "ii", &i1, &i2);
  size_ok(len, 2 * sizeof(int));
  int_ok(i1, 1);
  int_ok(i2, 2);
  long l1, l2;
  test("l");
  rewind(file);
  fput_long(0, file);
  rewind(file);
  len = funpack(file, "l", &l1);
  size_ok(len, 1 * sizeof(long));
  long_ok(l1, 0);
  test("ll");
  rewind(file);
  fput_long(1, file);
  fput_long(2, file);
  rewind(file);
  len = funpack(file, "ll", &l1, &l2);
  size_ok(len, 2 * sizeof(long));
  long_ok(l1, 1);
  long_ok(l2, 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10c0 <tmpfile@plt>
mov    %rax,-0x10(%rbp)
lea    0xdef(%rip),%rdi
call   10b0 <title@plt>
lea    0xdec(%rip),%rdi
call   1110 <test@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0xdd3(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   10f0 <fpack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   10e0 <size_ok@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
call   1060 <fget_short@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
lea    0xd93(%rip),%rdi
call   1110 <test@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0xd7a(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x0,%al
call   10f0 <fpack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   10e0 <size_ok@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
call   1060 <fget_short@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <int_ok@plt>
mov    -0x10(%rbp),%rdi
call   1060 <fget_short@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1030 <int_ok@plt>
lea    0xd21(%rip),%rdi
call   1110 <test@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0xd08(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   10f0 <fpack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   10e0 <size_ok@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
call   10d0 <fget_int@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
lea    0xcc8(%rip),%rdi
call   1110 <test@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0xcaf(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x0,%al
call   10f0 <fpack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x8,%esi
call   10e0 <size_ok@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
call   10d0 <fget_int@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <int_ok@plt>
mov    -0x10(%rbp),%rdi
call   10d0 <fget_int@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1030 <int_ok@plt>
lea    0xc56(%rip),%rdi
call   1110 <test@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0xc3d(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   10f0 <fpack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x8,%esi
call   10a0 <long_ok@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
call   1080 <fget_long@plt>
mov    %rax,%rdi
xor    %esi,%esi
call   10a0 <long_ok@plt>
lea    0xbfc(%rip),%rdi
call   1110 <test@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0xbe3(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x0,%al
call   10f0 <fpack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x10,%esi
call   10a0 <long_ok@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
call   1080 <fget_long@plt>
mov    %rax,%rdi
mov    $0x1,%esi
call   10a0 <long_ok@plt>
mov    -0x10(%rbp),%rdi
call   1080 <fget_long@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   10a0 <long_ok@plt>
lea    0xb87(%rip),%rdi
call   10b0 <title@plt>
lea    0xb73(%rip),%rdi
call   1110 <test@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1050 <fput_short@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0xb46(%rip),%rsi
lea    -0x1a(%rbp),%rdx
mov    $0x0,%al
call   1100 <funpack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   10e0 <size_ok@plt>
movswl -0x1a(%rbp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
lea    0xb16(%rip),%rdi
call   1110 <test@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1050 <fput_short@plt>
mov    -0x10(%rbp),%rsi
mov    $0x2,%edi
call   1050 <fput_short@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0xad8(%rip),%rsi
lea    -0x1a(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
mov    $0x0,%al
call   1100 <funpack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   10e0 <size_ok@plt>
movswl -0x1a(%rbp),%edi
mov    $0x1,%esi
call   1030 <int_ok@plt>
movswl -0x1c(%rbp),%edi
mov    $0x2,%esi
call   1030 <int_ok@plt>
lea    0xa98(%rip),%rdi
call   1110 <test@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1040 <fput_int@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0xa6b(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1100 <funpack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   10e0 <size_ok@plt>
mov    -0x20(%rbp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
lea    0xa3c(%rip),%rdi
call   1110 <test@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1040 <fput_int@plt>
mov    -0x10(%rbp),%rsi
mov    $0x2,%edi
call   1040 <fput_int@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0x9fe(%rip),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
mov    $0x0,%al
call   1100 <funpack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x8,%esi
call   10e0 <size_ok@plt>
mov    -0x20(%rbp),%edi
mov    $0x1,%esi
call   1030 <int_ok@plt>
mov    -0x24(%rbp),%edi
mov    $0x2,%esi
call   1030 <int_ok@plt>
lea    0x9c0(%rip),%rdi
call   1110 <test@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1090 <fput_long@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0x993(%rip),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x0,%al
call   1100 <funpack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x8,%esi
call   10e0 <size_ok@plt>
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
call   10a0 <long_ok@plt>
lea    0x963(%rip),%rdi
call   1110 <test@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1090 <fput_long@plt>
mov    -0x10(%rbp),%rsi
mov    $0x2,%edi
call   1090 <fput_long@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x10(%rbp),%rdi
lea    0x925(%rip),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rcx
mov    $0x0,%al
call   1100 <funpack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x10,%esi
call   10e0 <size_ok@plt>
mov    -0x30(%rbp),%rdi
mov    $0x1,%esi
call   10a0 <long_ok@plt>
mov    -0x38(%rbp),%rdi
mov    $0x2,%esi
call   10a0 <long_ok@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
xor    %eax,%eax
call   10c0 <tmpfile@plt>
mov    %rax,%rbx
lea    0xdf1(%rip),%rdi
call   10b0 <title@plt>
lea    0xdee(%rip),%r13
mov    %r13,%rdi
call   1110 <test@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   10f0 <fpack@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   10e0 <size_ok@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    %rbx,%rdi
call   1060 <fget_short@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
lea    0xda1(%rip),%rbp
mov    %rbp,%rdi
call   1110 <test@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x2,%ecx
xor    %eax,%eax
call   10f0 <fpack@plt>
mov    %rax,%rdi
mov    $0x4,%esi
call   10e0 <size_ok@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    %rbx,%rdi
call   1060 <fget_short@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <int_ok@plt>
mov    %rbx,%rdi
call   1060 <fget_short@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1030 <int_ok@plt>
lea    0xd3a(%rip),%r14
mov    %r14,%rdi
call   1110 <test@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   10f0 <fpack@plt>
mov    %rax,%rdi
mov    $0x4,%esi
call   10e0 <size_ok@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    %rbx,%rdi
call   10d0 <fget_int@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
lea    0xced(%rip),%rbp
mov    %rbp,%rdi
call   1110 <test@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x2,%ecx
xor    %eax,%eax
call   10f0 <fpack@plt>
mov    %rax,%rdi
mov    $0x8,%esi
call   10e0 <size_ok@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    %rbx,%rdi
call   10d0 <fget_int@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <int_ok@plt>
mov    %rbx,%rdi
call   10d0 <fget_int@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1030 <int_ok@plt>
lea    0xc86(%rip),%r12
mov    %r12,%rdi
call   1110 <test@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   10f0 <fpack@plt>
mov    %rax,%rdi
mov    $0x8,%esi
call   10a0 <long_ok@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    %rbx,%rdi
call   1080 <fget_long@plt>
mov    %rax,%rdi
xor    %esi,%esi
call   10a0 <long_ok@plt>
lea    0xc38(%rip),%rbp
mov    %rbp,%rdi
call   1110 <test@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    $0x1,%edx
mov    $0x2,%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10f0 <fpack@plt>
mov    %rax,%rdi
mov    $0x10,%esi
call   10a0 <long_ok@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    %rbx,%rdi
call   1080 <fget_long@plt>
mov    %rax,%rdi
mov    $0x1,%esi
call   10a0 <long_ok@plt>
mov    %rbx,%rdi
call   1080 <fget_long@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   10a0 <long_ok@plt>
lea    0xbce(%rip),%rdi
call   10b0 <title@plt>
mov    %r13,%rdi
call   1110 <test@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <fput_short@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
lea    0xc(%rsp),%r15
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1100 <funpack@plt>
mov    %rax,%rdi
mov    $0x2,%esi
call   10e0 <size_ok@plt>
movswl 0xc(%rsp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
lea    0xb69(%rip),%rbp
mov    %rbp,%rdi
call   1110 <test@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1050 <fput_short@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1050 <fput_short@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
lea    0xe(%rsp),%rcx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1100 <funpack@plt>
mov    %rax,%rdi
mov    $0x4,%esi
call   10e0 <size_ok@plt>
movswl 0xc(%rsp),%edi
mov    $0x1,%esi
call   1030 <int_ok@plt>
movswl 0xe(%rsp),%edi
mov    $0x2,%esi
call   1030 <int_ok@plt>
mov    %r14,%rdi
call   1110 <test@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <fput_int@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
lea    0x10(%rsp),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1100 <funpack@plt>
mov    %rax,%rdi
mov    $0x4,%esi
call   10e0 <size_ok@plt>
mov    0x10(%rsp),%edi
xor    %esi,%esi
call   1030 <int_ok@plt>
lea    0xaa4(%rip),%rbp
mov    %rbp,%rdi
call   1110 <test@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1040 <fput_int@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1040 <fput_int@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
lea    0x14(%rsp),%rcx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1100 <funpack@plt>
mov    %rax,%rdi
mov    $0x8,%esi
call   10e0 <size_ok@plt>
mov    0x10(%rsp),%edi
mov    $0x1,%esi
call   1030 <int_ok@plt>
mov    0x14(%rsp),%edi
mov    $0x2,%esi
call   1030 <int_ok@plt>
mov    %r12,%rdi
call   1110 <test@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1090 <fput_long@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
lea    0x18(%rsp),%r14
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1100 <funpack@plt>
mov    %rax,%rdi
mov    $0x8,%esi
call   10e0 <size_ok@plt>
mov    0x18(%rsp),%rdi
xor    %esi,%esi
call   10a0 <long_ok@plt>
lea    0x9e0(%rip),%rbp
mov    %rbp,%rdi
call   1110 <test@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1090 <fput_long@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1090 <fput_long@plt>
mov    %rbx,%rdi
call   1070 <rewind@plt>
lea    0x20(%rsp),%rcx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1100 <funpack@plt>
mov    %rax,%rdi
mov    $0x10,%esi
call   10e0 <size_ok@plt>
mov    0x18(%rsp),%rdi
mov    $0x1,%esi
call   10a0 <long_ok@plt>
mov    0x20(%rsp),%rdi
mov    $0x2,%esi
call   10a0 <long_ok@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"fpack()\00"
@.str.1 = [2 x i8] c"s\00"
@.str.2 = [3 x i8] c"ss\00"
@.str.3 = [2 x i8] c"i\00"
@.str.4 = [3 x i8] c"ii\00"
@.str.5 = [2 x i8] c"l\00"
@.str.6 = [3 x i8] c"ll\00"
@.str.7 = [10 x i8] c"funpack()\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i16
%5 = alloca i16
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
store i32 0, i32* %1
%10 = call i32* (...) @tmpfile()
store i32* %10, i32** %2
%11 = call i32 @title(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32*, i32** %2
%14 = call i32 @rewind(i32* %13)
%15 = load i32*, i32** %2
%16 = call i64 (i32*, i8*, i64, ...) @fpack(i32* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i64 0)
store i64 %16, i64* %3
%17 = load i64, i64* %3
%18 = call i32 @size_ok(i64 %17, i32 2)
%19 = load i32*, i32** %2
%20 = call i32 @rewind(i32* %19)
%21 = load i32*, i32** %2
%22 = call i32 @fget_short(i32* %21)
%23 = call i32 @int_ok(i32 %22, i32 0)
%24 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%25 = load i32*, i32** %2
%26 = call i32 @rewind(i32* %25)
%27 = load i32*, i32** %2
%28 = call i64 (i32*, i8*, i64, ...) @fpack(i32* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 1, i32 2)
store i64 %28, i64* %3
%29 = load i64, i64* %3
%30 = call i32 @size_ok(i64 %29, i32 4)
%31 = load i32*, i32** %2
%32 = call i32 @rewind(i32* %31)
%33 = load i32*, i32** %2
%34 = call i32 @fget_short(i32* %33)
%35 = call i32 @int_ok(i32 %34, i32 1)
%36 = load i32*, i32** %2
%37 = call i32 @fget_short(i32* %36)
%38 = call i32 @int_ok(i32 %37, i32 2)
%39 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%40 = load i32*, i32** %2
%41 = call i32 @rewind(i32* %40)
%42 = load i32*, i32** %2
%43 = call i64 (i32*, i8*, i64, ...) @fpack(i32* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i64 0)
store i64 %43, i64* %3
%44 = load i64, i64* %3
%45 = call i32 @size_ok(i64 %44, i32 4)
%46 = load i32*, i32** %2
%47 = call i32 @rewind(i32* %46)
%48 = load i32*, i32** %2
%49 = call i32 @fget_int(i32* %48)
%50 = call i32 @int_ok(i32 %49, i32 0)
%51 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%52 = load i32*, i32** %2
%53 = call i32 @rewind(i32* %52)
%54 = load i32*, i32** %2
%55 = call i64 (i32*, i8*, i64, ...) @fpack(i32* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 1, i32 2)
store i64 %55, i64* %3
%56 = load i64, i64* %3
%57 = call i32 @size_ok(i64 %56, i32 8)
%58 = load i32*, i32** %2
%59 = call i32 @rewind(i32* %58)
%60 = load i32*, i32** %2
%61 = call i32 @fget_int(i32* %60)
%62 = call i32 @int_ok(i32 %61, i32 1)
%63 = load i32*, i32** %2
%64 = call i32 @fget_int(i32* %63)
%65 = call i32 @int_ok(i32 %64, i32 2)
%66 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%67 = load i32*, i32** %2
%68 = call i32 @rewind(i32* %67)
%69 = load i32*, i32** %2
%70 = call i64 (i32*, i8*, i64, ...) @fpack(i32* %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i64 0)
store i64 %70, i64* %3
%71 = load i64, i64* %3
%72 = call i32 @long_ok(i64 %71, i32 8)
%73 = load i32*, i32** %2
%74 = call i32 @rewind(i32* %73)
%75 = load i32*, i32** %2
%76 = call i64 @fget_long(i32* %75)
%77 = call i32 @long_ok(i64 %76, i32 0)
%78 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%79 = load i32*, i32** %2
%80 = call i32 @rewind(i32* %79)
%81 = load i32*, i32** %2
%82 = call i64 (i32*, i8*, i64, ...) @fpack(i32* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i64 1, i64 2)
store i64 %82, i64* %3
%83 = load i64, i64* %3
%84 = call i32 @long_ok(i64 %83, i32 16)
%85 = load i32*, i32** %2
%86 = call i32 @rewind(i32* %85)
%87 = load i32*, i32** %2
%88 = call i64 @fget_long(i32* %87)
%89 = call i32 @long_ok(i64 %88, i32 1)
%90 = load i32*, i32** %2
%91 = call i64 @fget_long(i32* %90)
%92 = call i32 @long_ok(i64 %91, i32 2)
%93 = call i32 @title(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%94 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%95 = load i32*, i32** %2
%96 = call i32 @rewind(i32* %95)
%97 = load i32*, i32** %2
%98 = call i32 @fput_short(i32 0, i32* %97)
%99 = load i32*, i32** %2
%100 = call i32 @rewind(i32* %99)
%101 = load i32*, i32** %2
%102 = call i64 (i32*, i8*, ...) @funpack(i32* %101, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i16* %4)
store i64 %102, i64* %3
%103 = load i64, i64* %3
%104 = call i32 @size_ok(i64 %103, i32 2)
%105 = load i16, i16* %4
%106 = sext i16 %105 to i32
%107 = call i32 @int_ok(i32 %106, i32 0)
%108 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%109 = load i32*, i32** %2
%110 = call i32 @rewind(i32* %109)
%111 = load i32*, i32** %2
%112 = call i32 @fput_short(i32 1, i32* %111)
%113 = load i32*, i32** %2
%114 = call i32 @fput_short(i32 2, i32* %113)
%115 = load i32*, i32** %2
%116 = call i32 @rewind(i32* %115)
%117 = load i32*, i32** %2
%118 = call i64 (i32*, i8*, ...) @funpack(i32* %117, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i16* %4, i16* %5)
store i64 %118, i64* %3
%119 = load i64, i64* %3
%120 = call i32 @size_ok(i64 %119, i32 4)
%121 = load i16, i16* %4
%122 = sext i16 %121 to i32
%123 = call i32 @int_ok(i32 %122, i32 1)
%124 = load i16, i16* %5
%125 = sext i16 %124 to i32
%126 = call i32 @int_ok(i32 %125, i32 2)
%127 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%128 = load i32*, i32** %2
%129 = call i32 @rewind(i32* %128)
%130 = load i32*, i32** %2
%131 = call i32 @fput_int(i32 0, i32* %130)
%132 = load i32*, i32** %2
%133 = call i32 @rewind(i32* %132)
%134 = load i32*, i32** %2
%135 = call i64 (i32*, i8*, ...) @funpack(i32* %134, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %6)
store i64 %135, i64* %3
%136 = load i64, i64* %3
%137 = call i32 @size_ok(i64 %136, i32 4)
%138 = load i32, i32* %6
%139 = call i32 @int_ok(i32 %138, i32 0)
%140 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%141 = load i32*, i32** %2
%142 = call i32 @rewind(i32* %141)
%143 = load i32*, i32** %2
%144 = call i32 @fput_int(i32 1, i32* %143)
%145 = load i32*, i32** %2
%146 = call i32 @fput_int(i32 2, i32* %145)
%147 = load i32*, i32** %2
%148 = call i32 @rewind(i32* %147)
%149 = load i32*, i32** %2
%150 = call i64 (i32*, i8*, ...) @funpack(i32* %149, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6, i32* %7)
store i64 %150, i64* %3
%151 = load i64, i64* %3
%152 = call i32 @size_ok(i64 %151, i32 8)
%153 = load i32, i32* %6
%154 = call i32 @int_ok(i32 %153, i32 1)
%155 = load i32, i32* %7
%156 = call i32 @int_ok(i32 %155, i32 2)
%157 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%158 = load i32*, i32** %2
%159 = call i32 @rewind(i32* %158)
%160 = load i32*, i32** %2
%161 = call i32 @fput_long(i32 0, i32* %160)
%162 = load i32*, i32** %2
%163 = call i32 @rewind(i32* %162)
%164 = load i32*, i32** %2
%165 = call i64 (i32*, i8*, ...) @funpack(i32* %164, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i64* %8)
store i64 %165, i64* %3
%166 = load i64, i64* %3
%167 = call i32 @size_ok(i64 %166, i32 8)
%168 = load i64, i64* %8
%169 = call i32 @long_ok(i64 %168, i32 0)
%170 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%171 = load i32*, i32** %2
%172 = call i32 @rewind(i32* %171)
%173 = load i32*, i32** %2
%174 = call i32 @fput_long(i32 1, i32* %173)
%175 = load i32*, i32** %2
%176 = call i32 @fput_long(i32 2, i32* %175)
%177 = load i32*, i32** %2
%178 = call i32 @rewind(i32* %177)
%179 = load i32*, i32** %2
%180 = call i64 (i32*, i8*, ...) @funpack(i32* %179, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i64* %8, i64* %9)
store i64 %180, i64* %3
%181 = load i64, i64* %3
%182 = call i32 @size_ok(i64 %181, i32 16)
%183 = load i64, i64* %8
%184 = call i32 @long_ok(i64 %183, i32 1)
%185 = load i64, i64* %9
%186 = call i32 @long_ok(i64 %185, i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"fpack()\00"
@.str.1 = [2 x i8] c"s\00"
@.str.2 = [3 x i8] c"ss\00"
@.str.3 = [2 x i8] c"i\00"
@.str.4 = [3 x i8] c"ii\00"
@.str.5 = [2 x i8] c"l\00"
@.str.6 = [3 x i8] c"ll\00"
@.str.7 = [10 x i8] c"funpack()\00"
define i32 @main() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = tail call i32* (...) @tmpfile()
%8 = tail call i32 @title(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @rewind(i32* %7)
%11 = tail call i64 (i32*, i8*, i64, ...) @fpack(i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i64 0)
%12 = tail call i32 @size_ok(i64 %11, i32 2)
%13 = tail call i32 @rewind(i32* %7)
%14 = tail call i32 @fget_short(i32* %7)
%15 = tail call i32 @int_ok(i32 %14, i32 0)
%16 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%17 = tail call i32 @rewind(i32* %7)
%18 = tail call i64 (i32*, i8*, i64, ...) @fpack(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 1, i32 2)
%19 = tail call i32 @size_ok(i64 %18, i32 4)
%20 = tail call i32 @rewind(i32* %7)
%21 = tail call i32 @fget_short(i32* %7)
%22 = tail call i32 @int_ok(i32 %21, i32 1)
%23 = tail call i32 @fget_short(i32* %7)
%24 = tail call i32 @int_ok(i32 %23, i32 2)
%25 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%26 = tail call i32 @rewind(i32* %7)
%27 = tail call i64 (i32*, i8*, i64, ...) @fpack(i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i64 0)
%28 = tail call i32 @size_ok(i64 %27, i32 4)
%29 = tail call i32 @rewind(i32* %7)
%30 = tail call i32 @fget_int(i32* %7)
%31 = tail call i32 @int_ok(i32 %30, i32 0)
%32 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%33 = tail call i32 @rewind(i32* %7)
%34 = tail call i64 (i32*, i8*, i64, ...) @fpack(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 1, i32 2)
%35 = tail call i32 @size_ok(i64 %34, i32 8)
%36 = tail call i32 @rewind(i32* %7)
%37 = tail call i32 @fget_int(i32* %7)
%38 = tail call i32 @int_ok(i32 %37, i32 1)
%39 = tail call i32 @fget_int(i32* %7)
%40 = tail call i32 @int_ok(i32 %39, i32 2)
%41 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%42 = tail call i32 @rewind(i32* %7)
%43 = tail call i64 (i32*, i8*, i64, ...) @fpack(i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i64 0)
%44 = tail call i32 @long_ok(i64 %43, i32 8)
%45 = tail call i32 @rewind(i32* %7)
%46 = tail call i64 @fget_long(i32* %7)
%47 = tail call i32 @long_ok(i64 %46, i32 0)
%48 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%49 = tail call i32 @rewind(i32* %7)
%50 = tail call i64 (i32*, i8*, i64, ...) @fpack(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i64 1, i64 2)
%51 = tail call i32 @long_ok(i64 %50, i32 16)
%52 = tail call i32 @rewind(i32* %7)
%53 = tail call i64 @fget_long(i32* %7)
%54 = tail call i32 @long_ok(i64 %53, i32 1)
%55 = tail call i64 @fget_long(i32* %7)
%56 = tail call i32 @long_ok(i64 %55, i32 2)
%57 = tail call i32 @title(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%58 = bitcast i16* %1 to i8*
%59 = bitcast i16* %2 to i8*
%60 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%61 = tail call i32 @rewind(i32* %7)
%62 = tail call i32 @fput_short(i32 0, i32* %7)
%63 = tail call i32 @rewind(i32* %7)
%64 = call i64 (i32*, i8*, ...) @funpack(i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i16* %1)
%65 = call i32 @size_ok(i64 %64, i32 2)
%66 = load i16, i16* %1
%67 = sext i16 %66 to i32
%68 = call i32 @int_ok(i32 %67, i32 0)
%69 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%70 = call i32 @rewind(i32* %7)
%71 = call i32 @fput_short(i32 1, i32* %7)
%72 = call i32 @fput_short(i32 2, i32* %7)
%73 = call i32 @rewind(i32* %7)
%74 = call i64 (i32*, i8*, ...) @funpack(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i16* %1, i16* %2)
%75 = call i32 @size_ok(i64 %74, i32 4)
%76 = load i16, i16* %1
%77 = sext i16 %76 to i32
%78 = call i32 @int_ok(i32 %77, i32 1)
%79 = load i16, i16* %2
%80 = sext i16 %79 to i32
%81 = call i32 @int_ok(i32 %80, i32 2)
%82 = bitcast i32* %3 to i8*
%83 = bitcast i32* %4 to i8*
%84 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%85 = call i32 @rewind(i32* %7)
%86 = call i32 @fput_int(i32 0, i32* %7)
%87 = call i32 @rewind(i32* %7)
%88 = call i64 (i32*, i8*, ...) @funpack(i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%89 = call i32 @size_ok(i64 %88, i32 4)
%90 = load i32, i32* %3
%91 = call i32 @int_ok(i32 %90, i32 0)
%92 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%93 = call i32 @rewind(i32* %7)
%94 = call i32 @fput_int(i32 1, i32* %7)
%95 = call i32 @fput_int(i32 2, i32* %7)
%96 = call i32 @rewind(i32* %7)
%97 = call i64 (i32*, i8*, ...) @funpack(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3, i32* %4)
%98 = call i32 @size_ok(i64 %97, i32 8)
%99 = load i32, i32* %3
%100 = call i32 @int_ok(i32 %99, i32 1)
%101 = load i32, i32* %4
%102 = call i32 @int_ok(i32 %101, i32 2)
%103 = bitcast i64* %5 to i8*
%104 = bitcast i64* %6 to i8*
%105 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%106 = call i32 @rewind(i32* %7)
%107 = call i32 @fput_long(i32 0, i32* %7)
%108 = call i32 @rewind(i32* %7)
%109 = call i64 (i32*, i8*, ...) @funpack(i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i64* %5)
%110 = call i32 @size_ok(i64 %109, i32 8)
%111 = load i64, i64* %5
%112 = call i32 @long_ok(i64 %111, i32 0)
%113 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%114 = call i32 @rewind(i32* %7)
%115 = call i32 @fput_long(i32 1, i32* %7)
%116 = call i32 @fput_long(i32 2, i32* %7)
%117 = call i32 @rewind(i32* %7)
%118 = call i64 (i32*, i8*, ...) @funpack(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i64* %5, i64* %6)
%119 = call i32 @size_ok(i64 %118, i32 16)
%120 = load i64, i64* %5
%121 = call i32 @long_ok(i64 %120, i32 1)
%122 = load i64, i64* %6
%123 = call i32 @long_ok(i64 %122, i32 2)
ret i32 0
}