#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*/ assert(int);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memset(char *, char, size_t);
int strcmp(char *, char *);
int main(int argc, char **argv) {
  size_t size = 100;
  char fill = 'o';
  char *s1 = (char *)malloc(size);
  memset(s1, fill, size);
  char *s2 = (char *)malloc(size);
  memset(s2, fill, size);
  s1[size - 1] = 'z';
  s2[size - 1] = 'x';
  int r = strcmp(s1, s2);
  assert(r == 1);
  free(s1);
  free(s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x64,-0x18(%rbp)
movb   $0x6f,-0x19(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x19(%rbp),%al
mov    -0x18(%rbp),%rdx
movsbl %al,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rdi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x19(%rbp),%al
mov    -0x18(%rbp),%rdx
movsbl %al,%esi
call   1040 <memset@plt>
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0x30(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x78,(%rax,%rcx,1)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1050 <strcmp@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    $0x64,%edx
mov    %rax,%rdi
mov    $0x6f,%esi
call   1040 <memset@plt>
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    $0x64,%edx
mov    %rax,%rdi
mov    $0x6f,%esi
call   1040 <memset@plt>
movb   $0x7a,0x63(%r14)
movb   $0x78,0x63(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1060 <assert@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i8
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 100, i64* %6
store i8 111, i8* %7
%11 = load i64, i64* %6
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %8
%14 = load i8*, i8** %8
%15 = load i8, i8* %7
%16 = load i64, i64* %6
%17 = call i32 @memset(i8* %14, i8 signext %15, i64 %16)
%18 = load i64, i64* %6
%19 = call i64 @malloc(i64 %18)
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %9
%21 = load i8*, i8** %9
%22 = load i8, i8* %7
%23 = load i64, i64* %6
%24 = call i32 @memset(i8* %21, i8 signext %22, i64 %23)
%25 = load i8*, i8** %8
%26 = load i64, i64* %6
%27 = sub i64 %26, 1
%28 = getelementptr inbounds i8, i8* %25, i64 %27
store i8 122, i8* %28
%29 = load i8*, i8** %9
%30 = load i64, i64* %6
%31 = sub i64 %30, 1
%32 = getelementptr inbounds i8, i8* %29, i64 %31
store i8 120, i8* %32
%33 = load i8*, i8** %8
%34 = load i8*, i8** %9
%35 = call i32 @strcmp(i8* %33, i8* %34)
store i32 %35, i32* %10
%36 = load i32, i32* %10
%37 = icmp eq i32 %36, 1
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
%40 = load i8*, i8** %8
%41 = call i32 @free(i8* %40)
%42 = load i8*, i8** %9
%43 = call i32 @free(i8* %42)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i64 100)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @memset(i8* %4, i8 signext 111, i64 100)
%6 = tail call i64 @malloc(i64 100)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memset(i8* %7, i8 signext 111, i64 100)
%9 = getelementptr inbounds i8, i8* %4, i64 99
store i8 122, i8* %9
%10 = getelementptr inbounds i8, i8* %7, i64 99
store i8 120, i8* %10
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %7)
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @free(i8* %4)
%16 = tail call i32 @free(i8* %7)
ret i32 0
}