#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;
  unsigned int color;
  int /*<<< orphan*/ cmd;
};
typedef TYPE_1__ osd_cmd_t;

/* Variables and functions */
int /*<<< orphan*/ OSD_SEND_CMD;
int /*<<< orphan*/ OSD_SetPixel;
int ioctl(int, int /*<<< orphan*/, TYPE_1__ *);
int OSDSetPixel(int dev, int x, int y, unsigned int color) {
  osd_cmd_t dc;
  dc.cmd = OSD_SetPixel;
  dc.x0 = x;
  dc.y0 = y;
  dc.color = color;
  return ioctl(dev, OSD_SEND_CMD, &dc);
}


x86 assembly (clang, -O0):
<OSDSetPixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSDSetPixel>:
sub    $0x18,%rsp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    %esi,0x8(%rsp)
mov    %edx,0xc(%rsp)
mov    %ecx,0x10(%rsp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1030 <ioctl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32, i32 }
@OSD_SetPixel = global i32 0
@OSD_SEND_CMD = global i32 0
define i32 @OSDSetPixel(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.TYPE_3__
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* @OSD_SetPixel
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 3
store i32 %10, i32* %11
%12 = load i32, i32* %6
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
store i32 %12, i32* %13
%14 = load i32, i32* %7
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 1
store i32 %14, i32* %15
%16 = load i32, i32* %8
%17 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 2
store i32 %16, i32* %17
%18 = load i32, i32* %5
%19 = load i32, i32* @OSD_SEND_CMD
%20 = call i32 @ioctl(i32 %18, i32 %19, %struct.TYPE_3__* %9)
ret i32 %20
}

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