#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 *, int);
int string_contain(char *, int, char *, int);
int strlen(char *);
int main() {
  char str0[] = "this is a test";
  char str1[] = "ashd";
  int len0 = strlen(str0);
  int len1 = strlen(str1);
  printf("%d\n", string_contain(str0, len0, str1, len1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xeb9(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb1(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xea9(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0xea4(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0xf(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
lea    -0xf(%rbp),%rdi
mov    -0x18(%rbp),%esi
lea    -0x14(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1050 <string_contain@plt>
mov    %eax,%esi
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
movabs $0x74736574206120,%rax
mov    %rax,0x17(%rsp)
movabs $0x2073692073696874,%rax
69 73 20
mov    %rax,0x10(%rsp)
movb   $0x0,0xc(%rsp)
movl   $0x64687361,0x8(%rsp)
64
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1050 <string_contain@plt>
lea    0xe7f(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.str0 = [15 x i8] c"this is a test\00"
@__const.main.str1 = [5 x i8] c"ashd\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [5 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [15 x i8]* %1 to i8*
%6 = bitcast [5 x i8]* %2 to i8*
%7 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %3
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %4
%11 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%12 = load i32, i32* %3
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%14 = load i32, i32* %4
%15 = call i32 @string_contain(i8* %11, i32 %12, i8* %13, i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str0 = [15 x i8] c"this is a test\00"
@__const.main.str1 = [5 x i8] c"ashd\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @strlen(i8* %3)
%6 = call i32 @strlen(i8* %4)
%7 = call i32 @string_contain(i8* %3, i32 %5, i8* %4, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}