#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*/ printf(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char s[100] = {'a', 'b', '\0'};
  char t[100] = {'c', 'd', '\0'};
  printf("%s\n", s);
  assert(!strcmp(s, "abcd"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movb   $0x61,-0x80(%rbp)
movb   $0x62,-0x7f(%rbp)
lea    -0xf0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movb   $0x63,-0xf0(%rbp)
movb   $0x64,-0xef(%rbp)
lea    -0x80(%rbp),%rsi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x80(%rbp),%rdi
lea    0xe5e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movw   $0x6261,(%rsp)
lea    0xea7(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
mov    $0x64636261,%eax
xor    (%rsp),%eax
movzbl 0x4(%rsp),%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"abcd\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [100 x i8]
%6 = alloca [100 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = bitcast [100 x i8]* %5 to i8*
%8 = bitcast i8* %7 to <{ i8, i8, [98 x i8] }>*
%9 = getelementptr inbounds <{ i8, i8, [98 x i8] }>, <{ i8, i8, [98 x i8] }>* %8, i32 0, i32 0
store i8 97, i8* %9
%10 = getelementptr inbounds <{ i8, i8, [98 x i8] }>, <{ i8, i8, [98 x i8] }>* %8, i32 0, i32 1
store i8 98, i8* %10
%11 = bitcast [100 x i8]* %6 to i8*
%12 = bitcast i8* %11 to <{ i8, i8, [98 x i8] }>*
%13 = getelementptr inbounds <{ i8, i8, [98 x i8] }>, <{ i8, i8, [98 x i8] }>* %12, i32 0, i32 0
store i8 99, i8* %13
%14 = getelementptr inbounds <{ i8, i8, [98 x i8] }>, <{ i8, i8, [98 x i8] }>* %12, i32 0, i32 1
store i8 100, i8* %14
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"abcd\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i8 97, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 1
store i8 98, i8* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 5)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}