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

/* Variables and functions */
int /*<<< orphan*/ test_fail_message_prefix(char const *, char const *, int,
                                            char const *, char const *,
                                            char const *, char const *);
int /*<<< orphan*/ test_flush_stderr();
int /*<<< orphan*/ test_printf_stderr(char *);
int /*<<< orphan*/ test_vprintf_stderr(char const *, int /*<<< orphan*/);
void test_fail_message_va(const char *prefix, const char *file, int line,
                          const char *type, const char *left, const char *right,
                          const char *op, const char *fmt, va_list ap) {
  test_fail_message_prefix(prefix, file, line, type, left, right, op);
  if (fmt != NULL) {
    test_vprintf_stderr(fmt, ap);
    test_printf_stderr("\n");
  }
  test_flush_stderr();
}


x86 assembly (clang, -O0):
<test_fail_message_va>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <test_fail_message_prefix@plt>
cmpq   $0x0,0x18(%rbp)
je     11b1 <test_fail_message_va+0x71>
mov    0x18(%rbp),%rdi
mov    0x20(%rbp),%esi
call   1060 <test_vprintf_stderr@plt>
lea    0xe54(%rip),%rdi
call   1050 <test_printf_stderr@plt>
mov    $0x0,%al
call   1040 <test_flush_stderr@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fail_message_va>:
push   %rbp
push   %rbx
push   %rax
mov    0x30(%rsp),%ebp
mov    0x28(%rsp),%rbx
mov    0x20(%rsp),%rax
mov    %rax,(%rsp)
call   1030 <test_fail_message_prefix@plt>
test   %rbx,%rbx
je     1175 <test_fail_message_va+0x35>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1060 <test_vprintf_stderr@plt>
lea    0xe90(%rip),%rdi
call   1050 <test_printf_stderr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <test_flush_stderr@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @test_fail_message_va(i8* %0, i8* %1, i32 %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i32 %8) {
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i32
store i8* %0, i8** %10
store i8* %1, i8** %11
store i32 %2, i32* %12
store i8* %3, i8** %13
store i8* %4, i8** %14
store i8* %5, i8** %15
store i8* %6, i8** %16
store i8* %7, i8** %17
store i32 %8, i32* %18
%19 = load i8*, i8** %10
%20 = load i8*, i8** %11
%21 = load i32, i32* %12
%22 = load i8*, i8** %13
%23 = load i8*, i8** %14
%24 = load i8*, i8** %15
%25 = load i8*, i8** %16
%26 = call i32 @test_fail_message_prefix(i8* %19, i8* %20, i32 %21, i8* %22, i8* %23, i8* %24, i8* %25)
%27 = load i8*, i8** %17
%28 = icmp ne i8* %27, null
br i1 %28, label %29, label %34
29: ; preds = %9
%30 = load i8*, i8** %17
%31 = load i32, i32* %18
%32 = call i32 @test_vprintf_stderr(i8* %30, i32 %31)
%33 = call i32 @test_printf_stderr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %34
34: ; preds = %29, %9
%35 = call i32 (...) @test_flush_stderr()
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @test_fail_message_va(i8* %0, i8* %1, i32 %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i32 %8) {
%10 = tail call i32 @test_fail_message_prefix(i8* %0, i8* %1, i32 %2, i8* %3, i8* %4, i8* %5, i8* %6)
%11 = icmp eq i8* %7, null
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = tail call i32 @test_vprintf_stderr(i8* %7, i32 %8)
%14 = tail call i32 @test_printf_stderr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %12, %9
%16 = tail call i32 (...) @test_flush_stderr()
ret void
}