#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ pcmpestrm_debug(char *, char *, int, int);
int strlen(char *);
int main(int argc, char *argv[]) {
  if (argc < 5) {
    return EXIT_FAILURE;
  }
  int len1 = atoi(argv[3]);
  int len2 = atoi(argv[4]);
  int tmp;
  tmp = strlen(argv[1]);
  if (len1 > tmp)
    len1 = tmp;
  tmp = strlen(argv[2]);
  if (len2 > tmp)
    len2 = tmp;
  pcmpestrm_debug(argv[1], argv[2], len1, len2);
  return EXIT_SUCCESS;
}


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   $0x5,-0x8(%rbp)
jge    1161 <main+0x31>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ec <main+0xbc>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    11a3 <main+0x73>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    11c5 <main+0x95>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <pcmpestrm_debug@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x5,%edi
jge    1142 <main+0x12>
mov    0x2ea0(%rip),%rax
jmp    1193 <main+0x63>
mov    %rsi,%rbx
mov    0x18(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%r14d
mov    0x20(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%rdi
call   1030 <strlen@plt>
cmp    %eax,%r14d
cmovg  %eax,%r14d
mov    0x10(%rbx),%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
cmovg  %eax,%ebp
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1040 <pcmpestrm_debug@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 5
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
store i32 %12, i32* %3
br label %52
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 3
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %6
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 4
%20 = load i8*, i8** %19
%21 = call i32 @atoi(i8* %20)
store i32 %21, i32* %7
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @strlen(i8* %24)
store i32 %25, i32* %8
%26 = load i32, i32* %6
%27 = load i32, i32* %8
%28 = icmp sgt i32 %26, %27
br i1 %28, label %29, label %31
29: ; preds = %13
%30 = load i32, i32* %8
store i32 %30, i32* %6
br label %31
31: ; preds = %29, %13
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = call i32 @strlen(i8* %34)
store i32 %35, i32* %8
%36 = load i32, i32* %7
%37 = load i32, i32* %8
%38 = icmp sgt i32 %36, %37
br i1 %38, label %39, label %41
39: ; preds = %31
%40 = load i32, i32* %8
store i32 %40, i32* %7
br label %41
41: ; preds = %39, %31
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
%48 = load i32, i32* %6
%49 = load i32, i32* %7
%50 = call i32 @pcmpestrm_debug(i8* %44, i8* %47, i32 %48, i32 %49)
%51 = load i32, i32* @EXIT_SUCCESS
store i32 %51, i32* %3
br label %52
52: ; preds = %41, %11
%53 = load i32, i32* %3
ret i32 %53
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 5
br i1 %3, label %24, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 3
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 4
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @strlen(i8* %12)
%14 = icmp sgt i32 %7, %13
%15 = select i1 %14, i32 %13, i32 %7
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32 @strlen(i8* %17)
%19 = icmp sgt i32 %10, %18
%20 = select i1 %19, i32 %18, i32 %10
%21 = load i8*, i8** %11
%22 = load i8*, i8** %16
%23 = tail call i32 @pcmpestrm_debug(i8* %21, i8* %22, i32 %15, i32 %20)
br label %24
24: ; preds = %2, %4
%25 = phi i32* [ @EXIT_SUCCESS, %4 ], [ @EXIT_FAILURE, %2 ]
%26 = load i32, i32* %25
ret i32 %26
}