void __attribute__((noclone, no))
check(const char *func, int line, int res, int min, int max, char *dst,
      const char *fmt, ...) {
  __builtin_va_list va;
  __builtin_va_start(va, fmt);
  checkv(func, line, res, min, max, dst, fmt, va);
  __builtin_va_end(va);
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
test   %al,%al
je     114f <check+0x3f>
movaps %xmm0,-0xc0(%rbp)
movaps %xmm1,-0xb0(%rbp)
movaps %xmm2,-0xa0(%rbp)
movaps %xmm3,-0x90(%rbp)
movaps %xmm4,-0x80(%rbp)
movaps %xmm5,-0x70(%rbp)
movaps %xmm6,-0x60(%rbp)
movaps %xmm7,-0x50(%rbp)
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
lea    -0xf0(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x30,-0x3c(%rbp)
movl   $0x30,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    0x10(%rbp),%r10
mov    %rsp,%rax
lea    -0x40(%rbp),%r11
mov    %r11,0x8(%rax)
mov    %r10,(%rax)
xor    %eax,%eax
call   1030 <checkv@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
sub    $0xd8,%rsp
test   %al,%al
je     1152 <check+0x42>
movaps %xmm0,0x50(%rsp)
movaps %xmm1,0x60(%rsp)
movaps %xmm2,0x70(%rsp)
movaps %xmm3,0x80(%rsp)
movaps %xmm4,0x90(%rsp)
movaps %xmm5,0xa0(%rsp)
movaps %xmm6,0xb0(%rsp)
movaps %xmm7,0xc0(%rsp)
mov    0xe0(%rsp),%r10
lea    0x20(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0xe8(%rsp),%rax
mov    %rax,0x8(%rsp)
movabs $0x3000000030,%rax
mov    %rax,(%rsp)
mov    %rsp,%r11
xor    %eax,%eax
push   %r11
push   %r10
call   1030 <checkv@plt>
add    $0xe8,%rsp
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @check(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5, i8* %6, ...) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca [1 x %struct.__va_list_tag]
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%16 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %15, i64 0, i64 0
%17 = bitcast %struct.__va_list_tag* %16 to i8*
%18 = load i8*, i8** %8
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = load i32, i32* %11
%22 = load i32, i32* %12
%23 = load i8*, i8** %13
%24 = load i8*, i8** %14
%25 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %15, i64 0, i64 0
%26 = call i32 (i8*, i32, i32, i32, i32, i8*, i8*, %struct.__va_list_tag*, ...) bitcast (i32 (...)* @checkv to i32 (i8*, i32, i32, i32, i32, i8*, i8*, %struct.__va_list_tag*, ...)*)(i8* %18, i32 %19, i32 %20, i32 %21, i32 %22, i8* %23, i8* %24, %struct.__va_list_tag* %25)
%27 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %15, i64 0, i64 0
%28 = bitcast %struct.__va_list_tag* %27 to i8*
ret void
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @check(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5, i8* %6, ...) {
%8 = alloca [1 x %struct.__va_list_tag]
%9 = bitcast [1 x %struct.__va_list_tag]* %8 to i8*
%10 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %8, i64 0, i64 0
%11 = call i32 (i8*, i32, i32, i32, i32, i8*, i8*, %struct.__va_list_tag*, ...) bitcast (i32 (...)* @checkv to i32 (i8*, i32, i32, i32, i32, i8*, i8*, %struct.__va_list_tag*, ...)*)(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5, i8* %6, %struct.__va_list_tag* %10)
ret void
}