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

/* Variables and functions */
int RTP_get_header_len(unsigned char *);
int RTP_get_marker(unsigned char *);
int RTP_get_seq_num(unsigned char *);
int RTP_get_timestamp(unsigned char *);
int /*<<< orphan*/ printf(char *, int, ...);
void RTP_print_header(unsigned char *p) {
  int i;
  for (i = 0; i < RTP_get_header_len(p); i++) {
    printf("%02x ", p[i]);
  }
  printf(" seqN=%d timestamp=%d marker=%d", RTP_get_seq_num(p),
         RTP_get_timestamp(p), RTP_get_marker(p));
}


x86 assembly (clang, -O0):
<RTP_print_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <RTP_get_header_len@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    11a7 <RTP_print_header+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1163 <RTP_print_header+0x13>
mov    -0x8(%rbp),%rdi
call   1050 <RTP_get_seq_num@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <RTP_get_timestamp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <RTP_get_marker@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_print_header>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1070 <RTP_get_header_len@plt>
test   %eax,%eax
jle    1191 <RTP_print_header+0x41>
lea    0xe99(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
movzbl (%rbx,%rbp,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1070 <RTP_get_header_len@plt>
cltq
cmp    %rax,%rbp
jl     1170 <RTP_print_header+0x20>
mov    %rbx,%rdi
call   1050 <RTP_get_seq_num@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1060 <RTP_get_timestamp@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <RTP_get_marker@plt>
lea    0xe51(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%02x \00"
@.str.1 = [32 x i8] c" seqN=%d timestamp=%d marker=%d\00"
define void @RTP_print_header(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @RTP_get_header_len(i8* %6)
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %20
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %9
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %4
%21 = load i8*, i8** %2
%22 = call i32 @RTP_get_seq_num(i8* %21)
%23 = load i8*, i8** %2
%24 = call i32 @RTP_get_timestamp(i8* %23)
%25 = load i8*, i8** %2
%26 = call i32 @RTP_get_marker(i8* %25)
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %24, i32 %26)
ret void
}

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