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

/* Variables and functions */
scalar_t__ bundle_raw_get_sdnv_off(int /*<<< orphan*/ const *, int);
scalar_t__ sdnv_decode(int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int bunlde_raw_get_timestamp_and_seq(const uint8_t *bundle_raw,
                                     uint64_t *timestamp_time,
                                     uint64_t *timestamp_seq) {
  unsigned off = 0;
  off++;
  off += bundle_raw_get_sdnv_off(bundle_raw + off, 10);
  off += sdnv_decode(bundle_raw + off, timestamp_time);
  off += sdnv_decode(bundle_raw + off, timestamp_seq);
  return 0;
}


x86 assembly (clang, -O0):
<bunlde_raw_get_timestamp_and_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x2,%rax
add    %rax,%rdi
mov    $0xa,%esi
call   1040 <bundle_raw_get_sdnv_off@plt>
mov    %rax,%rcx
mov    -0x1c(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <sdnv_decode@plt>
mov    %rax,%rcx
mov    -0x1c(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <sdnv_decode@plt>
mov    %rax,%rcx
mov    -0x1c(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bunlde_raw_get_timestamp_and_seq>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
add    $0x4,%rdi
mov    $0xa,%esi
call   1040 <bundle_raw_get_sdnv_off@plt>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %ebx,%eax
lea    (%r12,%rax,4),%rdi
mov    %r15,%rsi
call   1030 <sdnv_decode@plt>
add    %ebx,%eax
lea    (%r12,%rax,4),%rdi
mov    %r14,%rsi
call   1030 <sdnv_decode@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @bunlde_raw_get_timestamp_and_seq(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 0, i32* %7
%8 = load i32, i32* %7
%9 = add i32 %8, 1
store i32 %9, i32* %7
%10 = load i32*, i32** %4
%11 = load i32, i32* %7
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = call i64 @bundle_raw_get_sdnv_off(i32* %13, i32 10)
%15 = load i32, i32* %7
%16 = zext i32 %15 to i64
%17 = add nsw i64 %16, %14
%18 = trunc i64 %17 to i32
store i32 %18, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32*, i32** %5
%24 = call i64 @sdnv_decode(i32* %22, i32* %23)
%25 = load i32, i32* %7
%26 = zext i32 %25 to i64
%27 = add nsw i64 %26, %24
%28 = trunc i64 %27 to i32
store i32 %28, i32* %7
%29 = load i32*, i32** %4
%30 = load i32, i32* %7
%31 = zext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %29, i64 %31
%33 = load i32*, i32** %6
%34 = call i64 @sdnv_decode(i32* %32, i32* %33)
%35 = load i32, i32* %7
%36 = zext i32 %35 to i64
%37 = add nsw i64 %36, %34
%38 = trunc i64 %37 to i32
store i32 %38, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @bunlde_raw_get_timestamp_and_seq(i32* %0, i32* %1, i32* %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = tail call i64 @bundle_raw_get_sdnv_off(i32* %4, i32 10)
%6 = add i64 %5, 1
%7 = and i64 %6, 4294967295
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i64 @sdnv_decode(i32* %8, i32* %1)
%10 = add i64 %6, %9
%11 = and i64 %10, 4294967295
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = tail call i64 @sdnv_decode(i32* %12, i32* %2)
ret i32 0
}