#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*/ fscanf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ strcmp(char *, char *);
unsigned long SkipFrame(FILE *Handle) {
  unsigned long Number;
  char Token[64];
  do {
    do
      fscanf(Handle, "%s", Token);
    while (strcmp(Token, "Frame"));
    fscanf(Handle, "%ld", &Number);
    fscanf(Handle, "%s", Token);
  } while (strcmp(Token, "Begin"));
  do
    fscanf(Handle, "%s", Token);
  while (strcmp(Token, "End"));
  return Number;
}


x86 assembly (clang, -O0):
<SkipFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1131 <SkipFrame+0x11>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fscanf@plt>
lea    -0x50(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1131 <SkipFrame+0x11>
mov    -0x8(%rbp),%rdi
lea    0xe9d(%rip),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <fscanf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    0xe7a(%rip),%rsi
mov    $0x0,%al
call   1030 <fscanf@plt>
lea    -0x50(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    112c <SkipFrame+0xc>
jmp    11ac <SkipFrame+0x8c>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    0xe45(%rip),%rsi
mov    $0x0,%al
call   1030 <fscanf@plt>
lea    -0x50(%rbp),%rdi
lea    0xe46(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ac <SkipFrame+0x8c>
mov    -0x10(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipFrame>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%rbx
lea    0xec8(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xebf(%rip),%r12
lea    0x8(%rsp),%rbp
lea    0xebd(%rip),%r13
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <fscanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1150 <SkipFrame+0x30>
mov    %rbx,%rdi
lea    0xe8f(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1030 <fscanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <fscanf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1150 <SkipFrame+0x30>
lea    0xe55(%rip),%r14
lea    0x10(%rsp),%rbp
lea    0xe5c(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1030 <fscanf@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11c0 <SkipFrame+0xa0>
mov    0x8(%rsp),%rax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"Frame\00"
@.str.2 = [4 x i8] c"%ld\00"
@.str.3 = [6 x i8] c"Begin\00"
@.str.4 = [4 x i8] c"End\00"
define i64 @SkipFrame(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca [64 x i8]
store i32* %0, i32** %2
br label %5
5: ; preds = %20, %1
br label %6
6: ; preds = %10, %5
%7 = load i32*, i32** %2
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%9 = call i32 (i32*, i8*, ...) @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp ne i64 %12, 0
br i1 %13, label %6, label %14
14: ; preds = %10
%15 = load i32*, i32** %2
%16 = call i32 (i32*, i8*, ...) @fscanf(i32* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %3)
%17 = load i32*, i32** %2
%18 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%19 = call i32 (i32*, i8*, ...) @fscanf(i32* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %14
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp ne i64 %22, 0
br i1 %23, label %5, label %24
24: ; preds = %20
br label %25
25: ; preds = %29, %24
%26 = load i32*, i32** %2
%27 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%28 = call i32 (i32*, i8*, ...) @fscanf(i32* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %27)
br label %29
29: ; preds = %25
%30 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp ne i64 %31, 0
br i1 %32, label %25, label %33
33: ; preds = %29
%34 = load i64, i64* %3
ret i64 %34
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"Frame\00"
@.str.2 = [4 x i8] c"%ld\00"
@.str.3 = [6 x i8] c"Begin\00"
@.str.4 = [4 x i8] c"End\00"
define i64 @SkipFrame(i32* nocapture %0) {
%2 = alloca i64
%3 = alloca [64 x i8]
%4 = bitcast i64* %2 to i8*
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
br label %6
6: ; preds = %10, %1
%7 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %6, %11
br label %6
11: ; preds = %6
%12 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %2)
%13 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%14 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %10
16: ; preds = %11, %16
%17 = call i32 (i32*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%18 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %16
20: ; preds = %16
%21 = load i64, i64* %2
ret i64 %21
}