#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*/ assert(int);
unsigned int make_pixel(int red, int green, int blue) {
  assert(0 <= red && red <= 255);
  assert(0 <= blue && blue <= 255);
  assert(0 <= blue && blue <= 255);
  unsigned int out = 0;
  out += blue;
  out += green << 8;
  out += red << 16;
  out += 0x01 << 24;
  return out;
}


x86 assembly (clang, -O0):
<make_pixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x11(%rbp)
jg     113e <make_pixel+0x2e>
cmpl   $0xff,-0x4(%rbp)
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0xc(%rbp),%ecx
mov    %al,-0x12(%rbp)
jg     1168 <make_pixel+0x58>
cmpl   $0xff,-0xc(%rbp)
setle  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0xc(%rbp),%ecx
mov    %al,-0x13(%rbp)
jg     1192 <make_pixel+0x82>
cmpl   $0xff,-0xc(%rbp)
setle  %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1000000,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_pixel>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%r14d
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x100,%ebx
setb   %dil
call   1030 <assert@plt>
xor    %ebp,%ebp
cmp    $0x100,%r15d
setb   %bpl
mov    %ebp,%edi
call   1030 <assert@plt>
mov    %ebp,%edi
call   1030 <assert@plt>
shl    $0x8,%r14d
shl    $0x10,%ebx
add    %r15d,%ebx
lea    (%r14,%rbx,1),%eax
add    $0x1000000,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @make_pixel(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = icmp sle i32 0, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %4
%12 = icmp sle i32 %11, 255
br label %13
13: ; preds = %10, %3
%14 = phi i1 [ false, %3 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %6
%18 = icmp sle i32 0, %17
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i32, i32* %6
%21 = icmp sle i32 %20, 255
br label %22
22: ; preds = %19, %13
%23 = phi i1 [ false, %13 ], [ %21, %19 ]
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = load i32, i32* %6
%27 = icmp sle i32 0, %26
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = load i32, i32* %6
%30 = icmp sle i32 %29, 255
br label %31
31: ; preds = %28, %22
%32 = phi i1 [ false, %22 ], [ %30, %28 ]
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
store i32 0, i32* %7
%35 = load i32, i32* %6
%36 = load i32, i32* %7
%37 = add i32 %36, %35
store i32 %37, i32* %7
%38 = load i32, i32* %5
%39 = shl i32 %38, 8
%40 = load i32, i32* %7
%41 = add i32 %40, %39
store i32 %41, i32* %7
%42 = load i32, i32* %4
%43 = shl i32 %42, 16
%44 = load i32, i32* %7
%45 = add i32 %44, %43
store i32 %45, i32* %7
%46 = load i32, i32* %7
%47 = add i32 %46, 16777216
store i32 %47, i32* %7
%48 = load i32, i32* %7
ret i32 %48
}

LLVM IR (-O2):
define i32 @make_pixel(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %0, 256
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp ult i32 %2, 256
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @assert(i32 %8)
%11 = shl i32 %1, 8
%12 = shl i32 %0, 16
%13 = add i32 %12, 16777216
%14 = add i32 %13, %2
%15 = add i32 %14, %11
ret i32 %15
}