#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 *data;
};

/* Variables and functions */
int n(struct can_frame);
int /*<<< orphan*/ printf(char *, int);
void dump_data_binary(struct can_frame frame, int offset) {
  int i;
  for (i = offset; i < (8 - n(frame)); i++) {
    printf("%c", frame.data[i]);
  }
}


x86 assembly (clang, -O0):
<dump_data_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <n@plt>
mov    %eax,%edx
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    117d <dump_data_binary+0x5d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <dump_data_binary+0x15>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_data_binary>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <n@plt>
mov    $0x8,%ecx
sub    %eax,%ecx
cmp    %ebp,%ecx
jle    1176 <dump_data_binary+0x56>
movslq %ebp,%rbp
lea    0xebd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx,%rbp,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <n@plt>
mov    $0x8,%ecx
sub    %eax,%ecx
movslq %ecx,%rax
cmp    %rax,%rbp
jl     1150 <dump_data_binary+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
@.str = [3 x i8] c"%c\00"
define void @dump_data_binary(i32* %0, i32 %1) {
%3 = alloca %struct.can_frame
%4 = alloca i32
%5 = alloca i32
%6 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %3, i32 0, i32 0
store i32* %0, i32** %6
store i32 %1, i32* %4
%7 = load i32, i32* %4
store i32 %7, i32* %5
br label %8
8: ; preds = %23, %2
%9 = load i32, i32* %5
%10 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %3, i32 0, i32 0
%11 = load i32*, i32** %10
%12 = call i32 @n(i32* %11)
%13 = sub nsw i32 8, %12
%14 = icmp slt i32 %9, %13
br i1 %14, label %15, label %26
15: ; preds = %8
%16 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %3, i32 0, i32 0
%17 = load i32*, i32** %16
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %15
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %8
26: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @dump_data_binary(i32* %0, i32 %1) {
%3 = tail call i32 @n(i32* %0)
%4 = sub nsw i32 8, %3
%5 = icmp sgt i32 %4, %1
br i1 %5, label %6, label %18
6: ; preds = %2
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ %7, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nsw i64 %9, 1
%14 = tail call i32 @n(i32* %0)
%15 = sub nsw i32 8, %14
%16 = sext i32 %15 to i64
%17 = icmp slt i64 %13, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %2
ret void
}