#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 */
unsigned int dcr_get(int);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int,
                          unsigned int, unsigned int);
int dmp_videopos(int argc, char **argv) {
  unsigned int vb_adr, vb_len, v_read, vb_left, isr;
  isr = dcr_get(0x140 + 0x12);
  vb_adr = dcr_get(0x140 + 0x27);
  vb_len = dcr_get(0x140 + 0x28);
  v_read = dcr_get(0x140 + 0x33);
  vb_left = dcr_get(0x140 + 0x34);
  printf("S/A/L/P/R:       %08x    %08x  %08x  %08x  %08x\n", isr, vb_adr,
         vb_len, v_read, vb_left);
  return (0);
}


x86 assembly (clang, -O0):
<dmp_videopos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x152,%edi
call   1030 <dcr_get@plt>
mov    %eax,-0x24(%rbp)
mov    $0x167,%edi
call   1030 <dcr_get@plt>
mov    %eax,-0x14(%rbp)
mov    $0x168,%edi
call   1030 <dcr_get@plt>
mov    %eax,-0x18(%rbp)
mov    $0x173,%edi
call   1030 <dcr_get@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x174,%edi
call   1030 <dcr_get@plt>
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmp_videopos>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x152,%edi
call   1030 <dcr_get@plt>
mov    %eax,%r14d
mov    $0x167,%edi
call   1030 <dcr_get@plt>
mov    %eax,%r15d
mov    $0x168,%edi
call   1030 <dcr_get@plt>
mov    %eax,%ebx
mov    $0x173,%edi
call   1030 <dcr_get@plt>
mov    %eax,%ebp
mov    $0x174,%edi
call   1030 <dcr_get@plt>
lea    0xe96(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
mov    %eax,%r9d
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"S/A/L/P/R: %08x %08x %08x %08x %08x\0A\00"
define i32 @dmp_videopos(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%10 = call i32 @dcr_get(i32 338)
store i32 %10, i32* %9
%11 = call i32 @dcr_get(i32 359)
store i32 %11, i32* %5
%12 = call i32 @dcr_get(i32 360)
store i32 %12, i32* %6
%13 = call i32 @dcr_get(i32 371)
store i32 %13, i32* %7
%14 = call i32 @dcr_get(i32 372)
store i32 %14, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = load i32, i32* %8
%20 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"S/A/L/P/R: %08x %08x %08x %08x %08x\0A\00"
define i32 @dmp_videopos(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @dcr_get(i32 338)
%4 = tail call i32 @dcr_get(i32 359)
%5 = tail call i32 @dcr_get(i32 360)
%6 = tail call i32 @dcr_get(i32 371)
%7 = tail call i32 @dcr_get(i32 372)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5, i32 %6, i32 %7)
ret i32 0
}