#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 int /*<<< orphan*/ DestBpp;

/* Variables and functions */
int /*<<< orphan*/ Generate(char *, unsigned int);
int main(int argc, char *argv[]) {
  unsigned Index;
  static unsigned DestBpp[] = {8, 16, 32};
  if (argc < 2)
    return 0;
  for (Index = 0; Index < sizeof(DestBpp) / sizeof(DestBpp[0]); Index++) {
    Generate(argv[1], DestBpp[Index]);
  }
  return 0;
}


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   $0x2,-0x8(%rbp)
jge    113c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1181 <main+0x71>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x3,%rax
jae    117a <main+0x6a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
lea    0x2ec4(%rip),%rax
mov    (%rax,%rcx,4),%esi
call   1030 <Generate@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1143 <main+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     1144 <main+0x34>
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    $0x8,%esi
call   1030 <Generate@plt>
mov    0x8(%rbx),%rdi
mov    $0x10,%esi
call   1030 <Generate@plt>
mov    0x8(%rbx),%rdi
mov    $0x20,%esi
call   1030 <Generate@plt>
pop    %rbx
xor    %eax,%eax
ret

LLVM IR (-O0):
@main.DestBpp = internal global [3 x i32] [i32 8, i32 16, i32 32]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %28
10: ; preds = %2
store i32 0, i32* %6
br label %11
11: ; preds = %24, %10
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
%14 = icmp ult i64 %13, 3
br i1 %14, label %15, label %27
15: ; preds = %11
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = load i32, i32* %6
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds [3 x i32], [3 x i32]* @main.DestBpp, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = call i32 @Generate(i8* %18, i32 %22)
br label %24
24: ; preds = %15
%25 = load i32, i32* %6
%26 = add i32 %25, 1
store i32 %26, i32* %6
br label %11
27: ; preds = %11
store i32 0, i32* %3
br label %28
28: ; preds = %27, %9
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @Generate(i8* %6, i32 8)
%8 = load i8*, i8** %5
%9 = tail call i32 @Generate(i8* %8, i32 16)
%10 = load i8*, i8** %5
%11 = tail call i32 @Generate(i8* %10, i32 32)
br label %12
12: ; preds = %4, %2
ret i32 0
}