#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x0;
  int y0;
  int x1;
  char *data;
  int color;
  int /*<<< orphan*/ cmd;
};
typedef TYPE_1__ osd_cmd_t;

/* Variables and functions */
int /*<<< orphan*/ OSD_SEND_CMD;
int /*<<< orphan*/ OSD_Text;
int ioctl(int, int /*<<< orphan*/, TYPE_1__ *);
int OSDText(int dev, int x, int y, int size, int color, const char *text) {
  osd_cmd_t dc;
  dc.cmd = OSD_Text;
  dc.x0 = x;
  dc.y0 = y;
  dc.x1 = size;
  dc.data = (char *)text;
  dc.color = color;
  return ioctl(dev, OSD_SEND_CMD, &dc);
}


x86 assembly (clang, -O0):
<OSDText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
lea    -0x40(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSDText>:
sub    $0x28,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x24(%rsp)
mov    %esi,0x8(%rsp)
mov    %edx,0xc(%rsp)
mov    %ecx,0x10(%rsp)
mov    %r9,0x18(%rsp)
mov    %r8d,0x20(%rsp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1030 <ioctl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32, i8*, i32, i32 }
@OSD_Text = global i32 0
@OSD_SEND_CMD = global i32 0
define i32 @OSDText(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca %struct.TYPE_3__
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%14 = load i32, i32* @OSD_Text
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 5
store i32 %14, i32* %15
%16 = load i32, i32* %8
%17 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 0
store i32 %16, i32* %17
%18 = load i32, i32* %9
%19 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 1
store i32 %18, i32* %19
%20 = load i32, i32* %10
%21 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 2
store i32 %20, i32* %21
%22 = load i8*, i8** %12
%23 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 3
store i8* %22, i8** %23
%24 = load i32, i32* %11
%25 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 4
store i32 %24, i32* %25
%26 = load i32, i32* %7
%27 = load i32, i32* @OSD_SEND_CMD
%28 = call i32 @ioctl(i32 %26, i32 %27, %struct.TYPE_3__* %13)
ret i32 %28
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32, i8*, i32, i32 }
@OSD_Text = global i32 0
@OSD_SEND_CMD = global i32 0
define i32 @OSDText(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca %struct.TYPE_3__
%8 = bitcast %struct.TYPE_3__* %7 to i8*
%9 = load i32, i32* @OSD_Text
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i64 0, i32 5
store i32 %9, i32* %10
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i64 0, i32 0
store i32 %1, i32* %11
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i64 0, i32 1
store i32 %2, i32* %12
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i64 0, i32 2
store i32 %3, i32* %13
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i64 0, i32 3
store i8* %5, i8** %14
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i64 0, i32 4
store i32 %4, i32* %15
%16 = load i32, i32* @OSD_SEND_CMD
%17 = call i32 @ioctl(i32 %0, i32 %16, %struct.TYPE_3__* %7)
ret i32 %17
}