#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*/ printf(char *);
scalar_t__ reg_match(int /*<<< orphan*/, int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ scanf(char *, char *, char *);
int main(int argc, char *argv[]) {
  int i = 0, j = 0;
  char reg[0xfff], sam[0xfff];
  scanf("%s%s", reg, sam);
  printf(reg_match(0, 0, reg, sam) ? "matched" : "not matched");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2020,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x1020(%rbp),%rsi
lea    -0x2020(%rbp),%rdx
lea    0xe94(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x1020(%rbp),%rdx
lea    -0x2020(%rbp),%rcx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <reg_match@plt>
mov    %rax,%rcx
lea    0xe73(%rip),%rdi
lea    0xe70(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x2020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x2008,%rsp
lea    0xebf(%rip),%rdi
lea    0x1000(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <scanf@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <reg_match@plt>
test   %rax,%rax
lea    0xe95(%rip),%rax
lea    0xe92(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x2008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [8 x i8] c"matched\00"
@.str.2 = [12 x i8] c"not matched\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [4095 x i8]
%9 = alloca [4095 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
%10 = getelementptr inbounds [4095 x i8], [4095 x i8]* %8, i64 0, i64 0
%11 = getelementptr inbounds [4095 x i8], [4095 x i8]* %9, i64 0, i64 0
%12 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = getelementptr inbounds [4095 x i8], [4095 x i8]* %8, i64 0, i64 0
%14 = getelementptr inbounds [4095 x i8], [4095 x i8]* %9, i64 0, i64 0
%15 = call i64 @reg_match(i32 0, i32 0, i8* %13, i8* %14)
%16 = icmp ne i64 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0)
%19 = call i32 @printf(i8* %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [8 x i8] c"matched\00"
@.str.2 = [12 x i8] c"not matched\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4095 x i8]
%4 = alloca [4095 x i8]
%5 = getelementptr inbounds [4095 x i8], [4095 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [4095 x i8], [4095 x i8]* %4, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i64 @reg_match(i32 0, i32 0, i8* %5, i8* %6)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%11 = call i32 @printf(i8* dereferenceable(1) %10)
ret i32 0
}