#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 */
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ cases;

/* Variables and functions */
scalar_t__ argb8888_get_alpha(scalar_t__);
int /*<<< orphan*/ assert(int);
void test_argb8888_get_alpha() {
  uint32_t cases[][2] = {{0xff0011bb, 0xff}, {0x12345678, 0x12}};
  int i;
  for (i = 0; i < sizeof(cases) / sizeof(cases[0]); ++i) {
    assert(cases[i][1] == argb8888_get_alpha(cases[i][0]));
  }
}


x86 assembly (clang, -O0):
<test_argb8888_get_alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x2,%rax
jae    11bc <test_argb8888_get_alpha+0x9c>
movslq -0x24(%rbp),%rcx
lea    -0x20(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
movslq -0x24(%rbp),%rcx
lea    -0x20(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rdi
call   1040 <argb8888_get_alpha@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115b <test_argb8888_get_alpha+0x3b>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_argb8888_get_alpha>:
push   %rax
mov    $0xff0011bb,%edi
call   1040 <argb8888_get_alpha@plt>
xor    %edi,%edi
cmp    $0xff,%rax
sete   %dil
call   1030 <assert@plt>
mov    $0x12345678,%edi
call   1040 <argb8888_get_alpha@plt>
xor    %edi,%edi
cmp    $0x12,%rax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@__const.test_argb8888_get_alpha.cases = [2 x [2 x i64]] [[2 x i64] [i64 4278194619, i64 255], [2 x i64] [i64 305419896, i64 18]]
define void @test_argb8888_get_alpha() {
%1 = alloca [2 x [2 x i64]]
%2 = alloca i32
%3 = bitcast [2 x [2 x i64]]* %1 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %23, %0
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = icmp ult i64 %6, 2
br i1 %7, label %8, label %26
8: ; preds = %4
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x [2 x i64]], [2 x [2 x i64]]* %1, i64 0, i64 %10
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
%13 = load i64, i64* %12
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [2 x [2 x i64]], [2 x [2 x i64]]* %1, i64 0, i64 %15
%17 = getelementptr inbounds [2 x i64], [2 x i64]* %16, i64 0, i64 0
%18 = load i64, i64* %17
%19 = call i64 @argb8888_get_alpha(i64 %18)
%20 = icmp eq i64 %13, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
br label %23
23: ; preds = %8
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %4
26: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @test_argb8888_get_alpha() {
%1 = tail call i64 @argb8888_get_alpha(i64 4278194619)
%2 = icmp eq i64 %1, 255
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @argb8888_get_alpha(i64 305419896)
%6 = icmp eq i64 %5, 18
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret void
}