#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 /*<<< orphan*/ debug_print(char *, int /*<<< orphan*/ *, char *, ...);
void print_buffer(char *buffer, FILE *out_file, const char *name) {
  debug_print("@bw", out_file,
              "\n\n------------------------------------------");
  debug_print("@bw", out_file, "\n\t    %s\n", name);
  debug_print("@bw", out_file,
              "------------------------------------------\n\n");
  debug_print("@bw", out_file, "%s", buffer);
}


x86 assembly (clang, -O0):
<print_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdi
lea    0xece(%rip),%rdx
mov    $0x0,%al
call   1030 <debug_print@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xeb4(%rip),%rdi
lea    0xede(%rip),%rdx
mov    $0x0,%al
call   1030 <debug_print@plt>
mov    -0x10(%rbp),%rsi
lea    0xe9b(%rip),%rdi
lea    0xecf(%rip),%rdx
mov    $0x0,%al
call   1030 <debug_print@plt>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rcx
lea    0xe7e(%rip),%rdi
lea    0xedf(%rip),%rdx
mov    $0x0,%al
call   1030 <debug_print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buffer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xed8(%rip),%r12
lea    0xed5(%rip),%rdx
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <debug_print@plt>
lea    0xef1(%rip),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rcx
xor    %eax,%eax
call   1030 <debug_print@plt>
lea    0xee4(%rip),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug_print@plt>
lea    0xefd(%rip),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <debug_print@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"@bw\00"
@.str.1 = [45 x i8] c"\0A\0A------------------------------------------\00"
@.str.2 = [10 x i8] c"\0A\09 %s\0A\00"
@.str.3 = [45 x i8] c"------------------------------------------\0A\0A\00"
@.str.4 = [3 x i8] c"%s\00"
define void @print_buffer(i8* %0, i32* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %5
%8 = call i32 (i8*, i32*, i8*, ...) @debug_print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %7, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32*, i32** %5
%10 = load i8*, i8** %6
%11 = call i32 (i8*, i32*, i8*, ...) @debug_print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = load i32*, i32** %5
%13 = call i32 (i8*, i32*, i8*, ...) @debug_print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %12, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32*, i32** %5
%15 = load i8*, i8** %4
%16 = call i32 (i8*, i32*, i8*, ...) @debug_print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"@bw\00"
@.str.1 = [45 x i8] c"\0A\0A------------------------------------------\00"
@.str.2 = [10 x i8] c"\0A\09 %s\0A\00"
@.str.3 = [45 x i8] c"------------------------------------------\0A\0A\00"
@.str.4 = [3 x i8] c"%s\00"
define void @print_buffer(i8* %0, i32* %1, i8* %2) {
%4 = tail call i32 (i8*, i32*, i8*, ...) @debug_print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i8*, i32*, i8*, ...) @debug_print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%6 = tail call i32 (i8*, i32*, i8*, ...) @debug_print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 (i8*, i32*, i8*, ...) @debug_print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %0)
ret void
}