#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 createBitmaskFromString(char *, int);
scalar_t__ isPangramBitmask(int, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int main(int argc, char **argv) {
  if (argc != 3) {
    printf("Error: missing alphabet or string\n");
    printf("\n");
    printf("Example:\n");
    printf("%s ABCDEFGHIJKLMNOPQRSTUVWXYZ \"The quick brown fox jumps over the "
           "lazy dog\"\n",
           argv[0]);
    return -1;
  }
  char *alphabet = argv[1];
  char *string = argv[2];
  int alphabetLen = strlen(alphabet);
  int stringLen = strlen(string);
  int bitmaskAlphabet = createBitmaskFromString(alphabet, alphabetLen);
  printf("Is Pangram: %s\n",
         isPangramBitmask(bitmaskAlphabet, string, stringLen) ? "yes" : "no");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11ab <main+0x6b>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1227 <main+0xe7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <createBitmaskFromString@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <isPangramBitmask@plt>
mov    %rax,%rcx
lea    0xe8b(%rip),%rsi
lea    0xe80(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    11ca <main+0x6a>
mov    0x8(%rbx),%r14
mov    0x10(%rbx),%rbx
mov    %r14,%rdi
call   1070 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1070 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
mov    %ebp,%esi
call   1050 <createBitmaskFromString@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
call   1060 <isPangramBitmask@plt>
test   %rax,%rax
lea    0xeb4(%rip),%rax
lea    0xea9(%rip),%rsi
cmove  %rax,%rsi
lea    0xe8e(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1202 <main+0xa2>
lea    0xe93(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe9f(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%rsi
lea    0xe0a(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Error: missing alphabet or string\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [10 x i8] c"Example:\0A\00"
@.str.3 = [77 x i8] c"%s ABCDEFGHIJKLMNOPQRSTUVWXYZ \22The quick brown fox jumps over the lazy dog\22\0A\00"
@.str.4 = [16 x i8] c"Is Pangram: %s\0A\00"
@.str.5 = [4 x i8] c"yes\00"
@.str.6 = [3 x i8] c"no\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 i32
%9 = alloca i32
%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, 3
br i1 %12, label %13, label %21
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.3, i64 0, i64 0), i8* %19)
store i32 -1, i32* %3
br label %43
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
store i8* %24, i8** %6
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
store i8* %27, i8** %7
%28 = load i8*, i8** %6
%29 = call i32 @strlen(i8* %28)
store i32 %29, i32* %8
%30 = load i8*, i8** %7
%31 = call i32 @strlen(i8* %30)
store i32 %31, i32* %9
%32 = load i8*, i8** %6
%33 = load i32, i32* %8
%34 = call i32 @createBitmaskFromString(i8* %32, i32 %33)
store i32 %34, i32* %10
%35 = load i32, i32* %10
%36 = load i8*, i8** %7
%37 = load i32, i32* %9
%38 = call i64 @isPangramBitmask(i32 %35, i8* %36, i32 %37)
%39 = icmp ne i64 %38, 0
%40 = zext i1 %39 to i64
%41 = select i1 %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0)
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %41)
store i32 0, i32* %3
br label %43
43: ; preds = %21, %13
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
@.str.3 = [77 x i8] c"%s ABCDEFGHIJKLMNOPQRSTUVWXYZ \22The quick brown fox jumps over the lazy dog\22\0A\00"
@.str.4 = [16 x i8] c"Is Pangram: %s\0A\00"
@.str.5 = [4 x i8] c"yes\00"
@.str.6 = [3 x i8] c"no\00"
@str = [34 x i8] c"Error: missing alphabet or string\00"
@str.7 = [9 x i8] c"Example:\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.7, i64 0, i64 0))
%8 = load i8*, i8** %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.3, i64 0, i64 0), i8* %8)
br label %22
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i32 @strlen(i8* %12)
%16 = tail call i32 @strlen(i8* %14)
%17 = tail call i32 @createBitmaskFromString(i8* %12, i32 %15)
%18 = tail call i64 @isPangramBitmask(i32 %17, i8* %14, i32 %16)
%19 = icmp eq i64 %18, 0
%20 = select i1 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %10, %4
%23 = phi i32 [ -1, %4 ], [ 0, %10 ]
ret i32 %23
}