#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_SUCCESS;
int /*<<< orphan*/ afree(char *);
char *alloc(int);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ strlcpy(char *, char *, int);
int main(int argc, char *argv[]) {
  int size = 50;
  char *str1 = alloc(size);
  char *str2 = alloc(size);
  strlcpy(str1, "abcdefghijklmnoprstuvwzx abcdefghijklmnoprstuvwzx", size);
  strlcpy(str2, "1234567890 1234567890 1234567890 1234567890 12345", size);
  printf("%s\n%s\n", str1, str2);
  afree(str2);
  afree(str1);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x32,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <alloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe7d(%rip),%rsi
call   1060 <strlcpy@plt>
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe9c(%rip),%rsi
call   1060 <strlcpy@plt>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1040 <afree@plt>
mov    -0x20(%rbp),%rdi
call   1040 <afree@plt>
mov    0x2e18(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x32,%edi
call   1050 <alloc@plt>
mov    %rax,%r14
mov    $0x32,%edi
call   1050 <alloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %r14,%rdi
mov    $0x32,%edx
call   1060 <strlcpy@plt>
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdi
mov    $0x32,%edx
call   1060 <strlcpy@plt>
lea    0xed7(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <afree@plt>
mov    %r14,%rdi
call   1040 <afree@plt>
mov    0x2e31(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [50 x i8] c"abcdefghijklmnoprstuvwzx abcdefghijklmnoprstuvwzx\00"
@.str.1 = [50 x i8] c"1234567890 1234567890 1234567890 1234567890 12345\00"
@.str.2 = [7 x i8] c"%s\0A%s\0A\00"
@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 i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 50, i32* %6
%9 = load i32, i32* %6
%10 = call i8* @alloc(i32 %9)
store i8* %10, i8** %7
%11 = load i32, i32* %6
%12 = call i8* @alloc(i32 %11)
store i8* %12, i8** %8
%13 = load i8*, i8** %7
%14 = load i32, i32* %6
%15 = call i32 @strlcpy(i8* %13, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i8*, i8** %8
%17 = load i32, i32* %6
%18 = call i32 @strlcpy(i8* %16, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = load i8*, i8** %7
%20 = load i8*, i8** %8
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %19, i8* %20)
%22 = load i8*, i8** %8
%23 = call i32 @afree(i8* %22)
%24 = load i8*, i8** %7
%25 = call i32 @afree(i8* %24)
%26 = load i32, i32* @EXIT_SUCCESS
ret i32 %26
}

LLVM IR (-O2):
@.str = [50 x i8] c"abcdefghijklmnoprstuvwzx abcdefghijklmnoprstuvwzx\00"
@.str.1 = [50 x i8] c"1234567890 1234567890 1234567890 1234567890 12345\00"
@.str.2 = [7 x i8] c"%s\0A%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @alloc(i32 50)
%4 = tail call i8* @alloc(i32 50)
%5 = tail call i32 @strlcpy(i8* %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 50)
%6 = tail call i32 @strlcpy(i8* %4, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 50)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %4)
%8 = tail call i32 @afree(i8* %4)
%9 = tail call i32 @afree(i8* %3)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}