#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 */
unsigned int UINT_MAX;
int /*<<< orphan*/ printf(char *, unsigned int, ...);
int /*<<< orphan*/ visualize(unsigned int);
unsigned int pack(unsigned char red, unsigned char green, unsigned char blue,
                  unsigned char alpha) {
  printf("Pack red=%u, green=%u, blue=%u, alpha=%u\n", red, green, blue, alpha);
  unsigned int result = UINT_MAX;
  printf("result %u\n", result);
  visualize(result);
  return result;
}


x86 assembly (clang, -O0):
<pack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movzbl -0x1(%rbp),%esi
movzbl -0x2(%rbp),%edx
movzbl -0x3(%rbp),%ecx
movzbl -0x4(%rbp),%r8d
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <visualize@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack>:
push   %rbx
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%ebx
lea    0xee2(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <visualize@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Pack red=%u, green=%u, blue=%u, alpha=%u\0A\00"
@UINT_MAX = global i32 0
@.str.1 = [11 x i8] c"result %u\0A\00"
define i32 @pack(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %13, i32 %15, i32 %17)
%19 = load i32, i32* @UINT_MAX
store i32 %19, i32* %9
%20 = load i32, i32* %9
%21 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %9
%23 = call i32 @visualize(i32 %22)
%24 = load i32, i32* %9
ret i32 %24
}

LLVM IR (-O2):
@.str = [42 x i8] c"Pack red=%u, green=%u, blue=%u, alpha=%u\0A\00"
@UINT_MAX = global i32 0
@.str.1 = [11 x i8] c"result %u\0A\00"
define i32 @pack(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = zext i8 %0 to i32
%6 = zext i8 %1 to i32
%7 = zext i8 %2 to i32
%8 = zext i8 %3 to i32
%9 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7, i32 %8)
%10 = load i32, i32* @UINT_MAX
%11 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = tail call i32 @visualize(i32 %10)
ret i32 %10
}