#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*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
scalar_t__ pattern_match(char *, char *, int);
int /*<<< orphan*/ stdout;
int strlen(char *);
int main(int argc, char **argv) {
  if (argc == 3) {
    int string_size = strlen(argv[1]);
    if (strlen(argv[2]) != string_size) {
      fprintf(stdout, "%s != %s\n", argv[1], argv[2]);
      return 1;
    }
    if (pattern_match(argv[1], argv[2], string_size))
      fprintf(stdout, "%s == %s\n", argv[1], argv[2]);
    else
      fprintf(stdout, "%s != %s\n", argv[1], argv[2]);
  }
  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   $0x3,-0x8(%rbp)
jne    121d <main+0xed>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <strlen@plt>
cmp    -0x14(%rbp),%eax
je     11a7 <main+0x77>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xe6a(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1224 <main+0xf4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x14(%rbp),%edx
call   1030 <pattern_match@plt>
cmp    $0x0,%rax
je     11f3 <main+0xc3>
mov    0x2e10(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xe21(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1218 <main+0xe8>
mov    0x2de6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xded(%rip),%rsi
call   1050 <fprintf@plt>
jmp    121d <main+0xed>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
cmp    $0x3,%edi
jne    11b6 <main+0x86>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <strlen@plt>
cmp    %ebp,%eax
jne    1185 <main+0x55>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
mov    %ebp,%edx
call   1030 <pattern_match@plt>
mov    0x2e73(%rip),%rcx
mov    (%rcx),%edi
mov    0x8(%rbx),%rdx
mov    0x10(%rbx),%rcx
test   %rax,%rax
je     11aa <main+0x7a>
lea    0xe87(%rip),%rsi
jmp    11b1 <main+0x81>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
mov    0x10(%rbx),%rcx
lea    0xe63(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%r14d
jmp    11b6 <main+0x86>
lea    0xe4f(%rip),%rsi
call   1050 <fprintf@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"%s != %s\0A\00"
@.str.1 = [10 x i8] c"%s == %s\0A\00"
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 eq i32 %7, 3
br i1 %8, label %9, label %58
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strlen(i8* %12)
store i32 %13, i32* %6
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @strlen(i8* %16)
%18 = load i32, i32* %6
%19 = icmp ne i32 %17, %18
br i1 %19, label %20, label %29
20: ; preds = %9
%21 = load i32, i32* @stdout
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %24, i8* %27)
store i32 1, i32* %3
br label %59
29: ; preds = %9
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = load i32, i32* %6
%37 = call i64 @pattern_match(i8* %32, i8* %35, i32 %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %48
39: ; preds = %29
%40 = load i32, i32* @stdout
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 1
%43 = load i8*, i8** %42
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 2
%46 = load i8*, i8** %45
%47 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %43, i8* %46)
br label %57
48: ; preds = %29
%49 = load i32, i32* @stdout
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 1
%52 = load i8*, i8** %51
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 2
%55 = load i8*, i8** %54
%56 = call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %52, i8* %55)
br label %57
57: ; preds = %48, %39
br label %58
58: ; preds = %57, %2
store i32 0, i32* %3
br label %59
59: ; preds = %58, %20
%60 = load i32, i32* %3
ret i32 %60
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"%s != %s\0A\00"
@.str.1 = [10 x i8] c"%s == %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %29
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strlen(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @strlen(i8* %9)
%11 = icmp eq i32 %10, %7
br i1 %11, label %12, label %24
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = load i8*, i8** %8
%15 = tail call i64 @pattern_match(i8* %13, i8* %14, i32 %7)
%16 = icmp eq i64 %15, 0
%17 = load i32, i32* @stdout
%18 = load i8*, i8** %5
%19 = load i8*, i8** %8
br i1 %16, label %22, label %20
20: ; preds = %12
%21 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %18, i8* %19)
br label %29
22: ; preds = %12
%23 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19)
br label %29
24: ; preds = %4
%25 = load i32, i32* @stdout
%26 = load i8*, i8** %5
%27 = load i8*, i8** %8
%28 = tail call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %26, i8* %27)
br label %29
29: ; preds = %22, %20, %2, %24
%30 = phi i32 [ 1, %24 ], [ 0, %2 ], [ 0, %20 ], [ 0, %22 ]
ret i32 %30
}