#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 any(char *, char *);
int /*<<< orphan*/ free(char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
void main() {
  int match;
  char *s = malloc(strlen("daniel") + 1);
  char *t = malloc(strlen("lgdhtposxl") + 1);
  strcpy(s, "daniel");
  strcpy(t, "lgdhtposxl");
  match = any(s, t);
  printf("s=%s \tt=%s\n", s, t);
  printf("match=%d \n", match);
  free(s);
  free(t);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe91(%rip),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe7c(%rip),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe55(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xe4c(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <any@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x7,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    $0xb,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe8b(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcpy@plt>
lea    0xe83(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <any@plt>
mov    %eax,%ebp
lea    0xe72(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe6a(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"daniel\00"
@.str.1 = [11 x i8] c"lgdhtposxl\00"
@.str.2 = [12 x i8] c"s=%s \09t=%s\0A\00"
@.str.3 = [11 x i8] c"match=%d \0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = call i64 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = add nsw i64 %4, 1
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %2
%7 = call i64 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = add nsw i64 %7, 1
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %3
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%14 = load i8*, i8** %2
%15 = load i8*, i8** %3
%16 = call i32 @any(i8* %14, i8* %15)
store i32 %16, i32* %1
%17 = load i8*, i8** %2
%18 = load i8*, i8** %3
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %17, i8* %18)
%20 = load i32, i32* %1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = load i8*, i8** %2
%23 = call i32 @free(i8* %22)
%24 = load i8*, i8** %3
%25 = call i32 @free(i8* %24)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"daniel\00"
@.str.1 = [11 x i8] c"lgdhtposxl\00"
@.str.2 = [12 x i8] c"s=%s \09t=%s\0A\00"
@.str.3 = [11 x i8] c"match=%d \0A\00"
define void @main() {
%1 = tail call dereferenceable_or_null(7) i8* @malloc(i64 7)
%2 = tail call dereferenceable_or_null(11) i8* @malloc(i64 11)
%3 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @any(i8* %1, i8* %2)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %1, i8* %2)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%8 = tail call i32 @free(i8* %1)
%9 = tail call i32 @free(i8* %2)
ret void
}