#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 char atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc != 5) {
    printf("Usage %s <red> <green> <blue> <alpha>\n", argv[0]);
    return 1;
  }
  unsigned char red = atoi(argv[1]);
  unsigned char green = atoi(argv[2]);
  unsigned char blue = atoi(argv[3]);
  unsigned char alpha = atoi(argv[4]);
  unsigned int colour = alpha << 24 | red << 16 | green << 8 | blue;
  printf("R: %u G: %u B: %u A: %u\nColour value: %u\n", red, green, blue, alpha,
         colour);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     1161 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e6 <main+0xc6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoi@plt>
mov    %al,-0x13(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1040 <atoi@plt>
mov    %al,-0x14(%rbp)
movzbl -0x14(%rbp),%eax
shl    $0x18,%eax
movzbl -0x11(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x12(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x13(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
movzbl -0x11(%rbp),%esi
movzbl -0x12(%rbp),%edx
movzbl -0x13(%rbp),%ecx
movzbl -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x5,%edi
jne    1197 <main+0x77>
mov    0x8(%rbx),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
mov    %eax,%r14d
mov    0x18(%rbx),%rdi
call   1040 <atoi@plt>
mov    %eax,%r15d
mov    0x20(%rbx),%rdi
call   1040 <atoi@plt>
movzbl %al,%r8d
mov    %r8d,%eax
shl    $0x18,%eax
movzbl %bpl,%esi
mov    %esi,%ecx
shl    $0x10,%ecx
or     %eax,%ecx
movzbl %r14b,%edx
mov    %edx,%r9d
shl    $0x8,%r9d
or     %ecx,%r9d
movzbl %r15b,%ecx
or     %ecx,%r9d
lea    0xe9b(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11ad <main+0x8d>
mov    (%rbx),%rsi
lea    0xe5f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Usage %s <red> <green> <blue> <alpha>\0A\00"
@.str.1 = [42 x i8] c"R: %u G: %u B: %u A: %u\0AColour value: %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 5
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %16)
store i32 1, i32* %3
br label %59
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call zeroext i8 @atoi(i8* %21)
store i8 %22, i8* %6
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call zeroext i8 @atoi(i8* %25)
store i8 %26, i8* %7
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 3
%29 = load i8*, i8** %28
%30 = call zeroext i8 @atoi(i8* %29)
store i8 %30, i8* %8
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 4
%33 = load i8*, i8** %32
%34 = call zeroext i8 @atoi(i8* %33)
store i8 %34, i8* %9
%35 = load i8, i8* %9
%36 = zext i8 %35 to i32
%37 = shl i32 %36, 24
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = shl i32 %39, 16
%41 = or i32 %37, %40
%42 = load i8, i8* %7
%43 = zext i8 %42 to i32
%44 = shl i32 %43, 8
%45 = or i32 %41, %44
%46 = load i8, i8* %8
%47 = zext i8 %46 to i32
%48 = or i32 %45, %47
store i32 %48, i32* %10
%49 = load i8, i8* %6
%50 = zext i8 %49 to i32
%51 = load i8, i8* %7
%52 = zext i8 %51 to i32
%53 = load i8, i8* %8
%54 = zext i8 %53 to i32
%55 = load i8, i8* %9
%56 = zext i8 %55 to i32
%57 = load i32, i32* %10
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %50, i32 %52, i32 %54, i32 %56, i32 %57)
br label %59
59: ; preds = %18, %13
%60 = load i32, i32* %3
ret i32 %60
}

LLVM IR (-O2):
@.str = [39 x i8] c"Usage %s <red> <green> <blue> <alpha>\0A\00"
@.str.1 = [42 x i8] c"R: %u G: %u B: %u A: %u\0AColour value: %u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 5
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %31
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call zeroext i8 @atoi(i8* %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call zeroext i8 @atoi(i8* %12)
%14 = getelementptr inbounds i8*, i8** %1, i64 3
%15 = load i8*, i8** %14
%16 = tail call zeroext i8 @atoi(i8* %15)
%17 = getelementptr inbounds i8*, i8** %1, i64 4
%18 = load i8*, i8** %17
%19 = tail call zeroext i8 @atoi(i8* %18)
%20 = zext i8 %19 to i32
%21 = shl nuw i32 %20, 24
%22 = zext i8 %10 to i32
%23 = shl nuw nsw i32 %22, 16
%24 = or i32 %21, %23
%25 = zext i8 %13 to i32
%26 = shl nuw nsw i32 %25, 8
%27 = or i32 %24, %26
%28 = zext i8 %16 to i32
%29 = or i32 %27, %28
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %25, i32 %28, i32 %20, i32 %29)
br label %31
31: ; preds = %7, %4
%32 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %32
}