#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*/ strcat(char *, char *);
char *strdup(int /*<<< orphan*/);
int strlen(char *);
int main() {
  char buffer[200] = "HALLO";
  char *b2 = strdup(strcat(buffer, "THis is a very long strings"));
  int len = strlen(b2);
  if (len < 12)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1040 <memset@plt>
movb   $0x48,-0xd0(%rbp)
movb   $0x41,-0xcf(%rbp)
movb   $0x4c,-0xce(%rbp)
movb   $0x4c,-0xcd(%rbp)
movb   $0x4f,-0xcc(%rbp)
lea    -0xd0(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1050 <strcat@plt>
mov    %eax,%edi
call   1060 <strdup@plt>
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xdc(%rbp)
cmpl   $0xc,-0xdc(%rbp)
jge    11d4 <main+0x94>
movl   $0x0,-0x4(%rbp)
jmp    11db <main+0x9b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xc8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0xc0(%rsp)
movl   $0x4c4c4148,(%rsp)
movb   $0x4f,0x4(%rsp)
lea    0xe60(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcat@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    %rax,%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    $0xc,%eax
setge  %cl
mov    %ecx,%eax
add    $0xc8,%rsp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"THis is a very long strings\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [200 x i8]* %2 to i8*
%6 = bitcast i8* %5 to [200 x i8]*
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i32 0, i32 0
store i8 72, i8* %7
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i32 0, i32 1
store i8 65, i8* %8
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i32 0, i32 2
store i8 76, i8* %9
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i32 0, i32 3
store i8 76, i8* %10
%11 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i32 0, i32 4
store i8 79, i8* %11
%12 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%13 = call i32 @strcat(i8* %12, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%14 = call i8* @strdup(i32 %13)
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = call i32 @strlen(i8* %15)
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 12
br i1 %18, label %19, label %20
19: ; preds = %0
store i32 0, i32* %1
br label %21
20: ; preds = %0
store i32 1, i32* %1
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [28 x i8] c"THis is a very long strings\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
store i8 72, i8* %2
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 1
store i8 65, i8* %3
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 2
store i8 76, i8* %4
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 3
store i8 76, i8* %5
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 4
store i8 79, i8* %6
%7 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = call i8* @strdup(i32 %7)
%9 = call i32 @strlen(i8* %8)
%10 = icmp sgt i32 %9, 11
%11 = zext i1 %10 to i32
ret i32 %11
}