#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 /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ streq(char *, char *);
int main(int argc, char *argv[]) {
  if (argc != 5)
    return 1;
  if (!streq(argv[1], "a"))
    return 2;
  if (!streq(argv[2], "bb"))
    return 2;
  if (!streq(argv[3], "ccc"))
    return 2;
  if (!streq(argv[4], "dddd"))
    return 2;
  puts("pass");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1203 <main+0xe3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea5(%rip),%rsi
call   1040 <streq@plt>
cmp    $0x0,%eax
jne    1175 <main+0x55>
movl   $0x2,-0x4(%rbp)
jmp    1203 <main+0xe3>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe7e(%rip),%rsi
call   1040 <streq@plt>
cmp    $0x0,%eax
jne    119e <main+0x7e>
movl   $0x2,-0x4(%rbp)
jmp    1203 <main+0xe3>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe58(%rip),%rsi
call   1040 <streq@plt>
cmp    $0x0,%eax
jne    11c7 <main+0xa7>
movl   $0x2,-0x4(%rbp)
jmp    1203 <main+0xe3>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xe33(%rip),%rsi
call   1040 <streq@plt>
cmp    $0x0,%eax
jne    11f0 <main+0xd0>
movl   $0x2,-0x4(%rbp)
jmp    1203 <main+0xe3>
lea    0xe17(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
cmp    $0x5,%edi
jne    1194 <main+0x74>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
lea    0xec4(%rip),%rsi
call   1040 <streq@plt>
mov    $0x2,%ebx
test   %eax,%eax
je     1194 <main+0x74>
mov    0x10(%r14),%rdi
lea    0xead(%rip),%rsi
call   1040 <streq@plt>
test   %eax,%eax
je     1194 <main+0x74>
mov    0x18(%r14),%rdi
lea    0xe9c(%rip),%rsi
call   1040 <streq@plt>
test   %eax,%eax
je     1194 <main+0x74>
mov    0x20(%r14),%rdi
lea    0xe8c(%rip),%rsi
call   1040 <streq@plt>
test   %eax,%eax
je     1194 <main+0x74>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [3 x i8] c"bb\00"
@.str.2 = [4 x i8] c"ccc\00"
@.str.3 = [5 x i8] c"dddd\00"
@.str.4 = [5 x i8] c"pass\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 5
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %39
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @streq(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %9
store i32 2, i32* %3
br label %39
16: ; preds = %9
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @streq(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %16
store i32 2, i32* %3
br label %39
23: ; preds = %16
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 3
%26 = load i8*, i8** %25
%27 = call i32 @streq(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp ne i32 %27, 0
br i1 %28, label %30, label %29
29: ; preds = %23
store i32 2, i32* %3
br label %39
30: ; preds = %23
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 4
%33 = load i8*, i8** %32
%34 = call i32 @streq(i8* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %30
store i32 2, i32* %3
br label %39
37: ; preds = %30
%38 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %39
39: ; preds = %37, %36, %29, %22, %15, %8
%40 = load i32, i32* %3
ret i32 %40
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [3 x i8] c"bb\00"
@.str.2 = [4 x i8] c"ccc\00"
@.str.3 = [5 x i8] c"dddd\00"
@.str.4 = [5 x i8] c"pass\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 5
br i1 %3, label %4, label %26
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @streq(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %26, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @streq(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %26, label %14
14: ; preds = %9
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @streq(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %26, label %19
19: ; preds = %14
%20 = getelementptr inbounds i8*, i8** %1, i64 4
%21 = load i8*, i8** %20
%22 = tail call i32 @streq(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %19
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %26
26: ; preds = %19, %14, %9, %4, %2, %24
%27 = phi i32 [ 0, %24 ], [ 1, %2 ], [ 2, %4 ], [ 2, %9 ], [ 2, %14 ], [ 2, %19 ]
ret i32 %27
}