#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 */
struct can_frame {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ sprint_canframe(char *, struct can_frame *, int);
void fprint_canframe(FILE *stream, struct can_frame *cf, char *eol, int sep) {
  char buf[sizeof("12345678#01.23.45.67.89.AB.CD.EF") + 1];
  sprint_canframe(buf, cf, sep);
  fprintf(stream, "%s", buf);
  if (eol)
    fprintf(stream, "%s", eol);
}


x86 assembly (clang, -O0):
<fprint_canframe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <sprint_canframe@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rdx
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
cmpq   $0x0,-0x18(%rbp)
je     117a <fprint_canframe+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe8b(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_canframe>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %ecx,%edx
call   1040 <sprint_canframe@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
test   %r14,%r14
je     1157 <fprint_canframe+0x37>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.can_frame = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @fprint_canframe(i32* %0, %struct.can_frame* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca %struct.can_frame*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [34 x i8]
store i32* %0, i32** %5
store %struct.can_frame* %1, %struct.can_frame** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [34 x i8], [34 x i8]* %9, i64 0, i64 0
%11 = load %struct.can_frame*, %struct.can_frame** %6
%12 = load i32, i32* %8
%13 = call i32 @sprint_canframe(i8* %10, %struct.can_frame* %11, i32 %12)
%14 = load i32*, i32** %5
%15 = getelementptr inbounds [34 x i8], [34 x i8]* %9, i64 0, i64 0
%16 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %7
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %23
19: ; preds = %4
%20 = load i32*, i32** %5
%21 = load i8*, i8** %7
%22 = call i32 @fprintf(i32* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %19, %4
ret void
}

LLVM IR (-O2):
%struct.can_frame = type { i32 }
define void @fprint_canframe(i32* nocapture %0, %struct.can_frame* %1, i8* %2, i32 %3) {
%5 = alloca [34 x i8]
%6 = getelementptr inbounds [34 x i8], [34 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprint_canframe(i8* %6, %struct.can_frame* %1, i32 %3)
%8 = call i32 @fputs(i8* %6, i32* %0)
%9 = icmp eq i8* %2, null
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = call i32 @fputs(i8* %2, i32* %0)
br label %12
12: ; preds = %10, %4
ret void
}