#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*/ SEEK_SET;
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
void *video_stream_info(FILE *f, int len) {
  int orig_pos = ftell(f);
  unsigned char data[len - 8];
  int i;
  char codec[len - 8];
  len -= 8;
  for (i = 0; i < len; i++)
    fread(&data[i], 1, 1, f);
  fseek(f, orig_pos, SEEK_SET);
}


x86 assembly (clang, -O0):
<video_stream_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0xfffffff8,%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
mov    %eax,%eax
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11c5 <video_stream_info+0x95>
mov    -0x40(%rbp),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1190 <video_stream_info+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    0x2e0d(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_stream_info>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r12d
mov    %rdi,%r15
call   1040 <ftell@plt>
mov    %eax,%r14d
lea    -0x8(%r12),%r13d
mov    %rsp,%rbx
lea    0xf(%r13),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
cmp    $0x9,%r12d
jl     118f <video_stream_info+0x5f>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r13
jne    1170 <video_stream_info+0x40>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
mov    %r14d,%esi
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i8* @video_stream_info(i32* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i64
store i32* %0, i32** %4
store i32 %1, i32* %5
%11 = load i32*, i32** %4
%12 = call i32 @ftell(i32* %11)
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 8
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %7
%17 = alloca i8, i64 %15
store i64 %15, i64* %8
%18 = load i32, i32* %5
%19 = sub nsw i32 %18, 8
%20 = zext i32 %19 to i64
%21 = alloca i8, i64 %20
store i64 %20, i64* %10
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 8
store i32 %23, i32* %5
store i32 0, i32* %9
br label %24
24: ; preds = %34, %2
%25 = load i32, i32* %9
%26 = load i32, i32* %5
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %37
28: ; preds = %24
%29 = load i32, i32* %9
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %17, i64 %30
%32 = load i32*, i32** %4
%33 = call i32 @fread(i8* %31, i32 1, i32 1, i32* %32)
br label %34
34: ; preds = %28
%35 = load i32, i32* %9
%36 = add nsw i32 %35, 1
store i32 %36, i32* %9
br label %24
37: ; preds = %24
%38 = load i32*, i32** %4
%39 = load i32, i32* %6
%40 = load i32, i32* @SEEK_SET
%41 = call i32 @fseek(i32* %38, i32 %39, i32 %40)
%42 = load i8*, i8** %7
%43 = load i8*, i8** %3
ret i8* %43
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define noalias i8* @video_stream_info(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @ftell(i32* %0)
%4 = add i32 %1, -8
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = icmp sgt i32 %1, 8
br i1 %7, label %8, label %14
8: ; preds = %2, %8
%9 = phi i64 [ %12, %8 ], [ 0, %2 ]
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = call i32 @fread(i8* %10, i32 1, i32 1, i32* %0)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %8
14: ; preds = %8, %2
%15 = load i32, i32* @SEEK_SET
%16 = tail call i32 @fseek(i32* %0, i32 %3, i32 %15)
ret i8* undef
}