#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;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char const *,
                            int /*<<< orphan*/);
void print_raw(FILE *out, const char *prefix, const char *module,
               const char *file, long line, const char *format,
               va_list param_list) {
  if (file == NULL) {
    fprintf(out, "%s (%s): ", prefix, module);
  } else {
    fprintf(out, "%s (%s:%ld): ", prefix, file, line);
  }
  vfprintf(out, format, param_list);
  fprintf(out, "\n");
}


x86 assembly (clang, -O0):
<print_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116d <print_raw+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe9f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    118b <print_raw+0x6b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    0xe86(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    0x10(%rbp),%edx
call   1040 <vfprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe72(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_raw>:
push   %rbp
push   %r14
push   %rbx
mov    %r9,%r14
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    0x20(%rsp),%ebp
test   %rcx,%rcx
je     115c <print_raw+0x2c>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1170 <print_raw+0x40>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <vfprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fputc@plt>

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

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