#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 /*<<< orphan*/ mpgedit_play_close(void *);
void *mpgedit_play_init(char *, int /*<<< orphan*/);
char *mpgedit_play_total_msec(void *);
char *mpgedit_play_total_sec(void *);
char *mpgedit_play_total_size(void *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  void *ctx;
  if (argc == 1) {
    printf("%s: mpg_file\n", argv[0]);
    return 1;
  }
  ctx = mpgedit_play_init(argv[1], 0);
  if (ctx) {
    printf("total file size %ld\n", mpgedit_play_total_size(ctx));
    printf("total sec       %ld\n", mpgedit_play_total_sec(ctx));
    printf("total msec      %ld\n", mpgedit_play_total_msec(ctx));
    mpgedit_play_close(ctx);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    119f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe72(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1215 <main+0xb5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
call   1030 <mpgedit_play_init@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     120e <main+0xae>
mov    -0x18(%rbp),%rdi
call   1040 <mpgedit_play_total_size@plt>
mov    %rax,%rsi
lea    0xe3e(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1080 <mpgedit_play_total_sec@plt>
mov    %rax,%rsi
lea    0xe3b(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <mpgedit_play_total_msec@plt>
mov    %rax,%rsi
lea    0xe38(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1070 <mpgedit_play_close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    117e <main+0x1e>
mov    (%rsi),%rsi
lea    0xe8e(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%ebp
jmp    11e0 <main+0x80>
mov    0x8(%rsi),%rdi
xor    %ebp,%ebp
xor    %esi,%esi
call   1030 <mpgedit_play_init@plt>
test   %rax,%rax
je     11e0 <main+0x80>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <mpgedit_play_total_size@plt>
lea    0xe6c(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1080 <mpgedit_play_total_sec@plt>
lea    0xe6a(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <mpgedit_play_total_msec@plt>
lea    0xe68(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1070 <mpgedit_play_close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s: mpg_file\0A\00"
@.str.1 = [21 x i8] c"total file size %ld\0A\00"
@.str.2 = [21 x i8] c"total sec %ld\0A\00"
@.str.3 = [21 x i8] c"total msec %ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %3
br label %34
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i8* @mpgedit_play_init(i8* %17, i32 0)
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %33
21: ; preds = %14
%22 = load i8*, i8** %6
%23 = call i8* @mpgedit_play_total_size(i8* %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %23)
%25 = load i8*, i8** %6
%26 = call i8* @mpgedit_play_total_sec(i8* %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = load i8*, i8** %6
%29 = call i8* @mpgedit_play_total_msec(i8* %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %29)
%31 = load i8*, i8** %6
%32 = call i32 @mpgedit_play_close(i8* %31)
br label %33
33: ; preds = %21, %14
store i32 0, i32* %3
br label %34
34: ; preds = %33, %9
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: mpg_file\0A\00"
@.str.1 = [21 x i8] c"total file size %ld\0A\00"
@.str.2 = [21 x i8] c"total sec %ld\0A\00"
@.str.3 = [21 x i8] c"total msec %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %20
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i8* @mpgedit_play_init(i8* %9, i32 0)
%11 = icmp eq i8* %10, null
br i1 %11, label %20, label %12
12: ; preds = %7
%13 = tail call i8* @mpgedit_play_total_size(i8* %10)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = tail call i8* @mpgedit_play_total_sec(i8* %10)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = tail call i8* @mpgedit_play_total_msec(i8* %10)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = tail call i32 @mpgedit_play_close(i8* %10)
br label %20
20: ; preds = %7, %12, %4
%21 = phi i32 [ 1, %4 ], [ 0, %12 ], [ 0, %7 ]
ret i32 %21
}