#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*/ Write32(void *, int, int);
int /*<<< orphan*/ dprintf(char *);
int /*<<< orphan*/ omap_beagle_init();
int /*<<< orphan*/ omap_clock_init();
int /*<<< orphan*/ omap_dispc_init();
int /*<<< orphan*/ omap_dss_init();
int /*<<< orphan*/ omap_set_lcd_mode(int, int);
int /*<<< orphan*/ omap_venc_init(int);
void video_init(int width, int height) {
  dprintf("omap3: video_init()\n");
  Write32(((void *)0x48050400), 0x01C, 0x00000);
  Write32(((void *)0x48050400), 0x018, 0x1ffff);
  omap_beagle_init();
  omap_clock_init();
  omap_dss_init();
  omap_venc_init((1));
  omap_dispc_init();
  omap_set_lcd_mode(width, height);
}


x86 assembly (clang, -O0):
<video_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xe6b(%rip),%rdi
call   1050 <dprintf@plt>
mov    $0x48050400,%edi
mov    $0x1c,%esi
xor    %edx,%edx
call   1040 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x18,%esi
mov    $0x1ffff,%edx
call   1040 <Write32@plt>
mov    $0x0,%al
call   1060 <omap_beagle_init@plt>
mov    $0x0,%al
call   10a0 <omap_clock_init@plt>
mov    $0x0,%al
call   1090 <omap_dss_init@plt>
mov    $0x1,%edi
call   1030 <omap_venc_init@plt>
mov    $0x0,%al
call   1070 <omap_dispc_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1080 <omap_set_lcd_mode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_init>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xe72(%rip),%rdi
call   1050 <dprintf@plt>
mov    $0x48050400,%edi
mov    $0x1c,%esi
xor    %edx,%edx
call   1040 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x18,%esi
mov    $0x1ffff,%edx
call   1040 <Write32@plt>
xor    %eax,%eax
call   1060 <omap_beagle_init@plt>
xor    %eax,%eax
call   10a0 <omap_clock_init@plt>
xor    %eax,%eax
call   1090 <omap_dss_init@plt>
mov    $0x1,%edi
call   1030 <omap_venc_init@plt>
xor    %eax,%eax
call   1070 <omap_dispc_init@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1080 <omap_set_lcd_mode@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"omap3: video_init()\0A\00"
define void @video_init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @dprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 28, i32 0)
%7 = call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 24, i32 131071)
%8 = call i32 (...) @omap_beagle_init()
%9 = call i32 (...) @omap_clock_init()
%10 = call i32 (...) @omap_dss_init()
%11 = call i32 @omap_venc_init(i32 1)
%12 = call i32 (...) @omap_dispc_init()
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @omap_set_lcd_mode(i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"omap3: video_init()\0A\00"
define void @video_init(i32 %0, i32 %1) {
%3 = tail call i32 @dprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 28, i32 0)
%5 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 24, i32 131071)
%6 = tail call i32 (...) @omap_beagle_init()
%7 = tail call i32 (...) @omap_clock_init()
%8 = tail call i32 (...) @omap_dss_init()
%9 = tail call i32 @omap_venc_init(i32 1)
%10 = tail call i32 (...) @omap_dispc_init()
%11 = tail call i32 @omap_set_lcd_mode(i32 %0, i32 %1)
ret void
}