#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 */
typedef int /*<<< orphan*/ buf9;
typedef int /*<<< orphan*/ buf8;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int /*<<< orphan*/ system(char *);
int main01(void) {
  char buf[] = {'a', 'b', 'c'};
  printf("buf = %s\n", buf);
  char buf2[100] = {'a', 'b', 'c'};
  printf("buf2 = %s\n", buf2);
  char buf3[100] = {0};
  char buf5[50] = {'1', 'a', 'b', '0', '7'};
  printf("buf5 = %s\n", buf5);
  char buf6[50] = {'1', 'a', 'b', 0, '7'};
  printf("buf6 = %s\n", buf6);
  char buf7[50] = {'1', 'a', 'b', '\0', '7'};
  printf("buf7 = %s\n", buf7);
  char buf8[] = "agjdslgjlsdjg";
  printf("strlen = %d, sizeof = %d\n", strlen(buf8), sizeof(buf8));
  char buf9[100] = "agjdslgjlsdjg";
  printf("strlen = %d, sizeof = %d\n", strlen(buf9), sizeof(buf9));
  printf("test");
  char str[] = "\0129";
  printf("%s\n", str);
  printf("\n");
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    0xe9e(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xe96(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x3(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
movb   $0x61,-0x70(%rbp)
movb   $0x62,-0x6f(%rbp)
movb   $0x63,-0x6e(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1060 <memset@plt>
movb   $0x31,-0x120(%rbp)
movb   $0x61,-0x11f(%rbp)
movb   $0x62,-0x11e(%rbp)
movb   $0x30,-0x11d(%rbp)
movb   $0x37,-0x11c(%rbp)
lea    -0x120(%rbp),%rsi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x160(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1060 <memset@plt>
movb   $0x31,-0x160(%rbp)
movb   $0x61,-0x15f(%rbp)
movb   $0x62,-0x15e(%rbp)
movb   $0x37,-0x15c(%rbp)
lea    -0x160(%rbp),%rsi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1060 <memset@plt>
movb   $0x31,-0x1a0(%rbp)
movb   $0x61,-0x19f(%rbp)
movb   $0x62,-0x19e(%rbp)
movb   $0x37,-0x19c(%rbp)
lea    -0x1a0(%rbp),%rsi
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0xe0e(%rip),%rax
mov    %rax,-0x1ae(%rbp)
mov    0xe09(%rip),%eax
mov    %eax,-0x1a6(%rbp)
mov    0xe00(%rip),%ax
mov    %ax,-0x1a2(%rbp)
lea    -0x1ae(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xde6(%rip),%rdi
mov    $0xe,%edx
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x220(%rbp),%rdi
lea    0xd24(%rip),%rsi
mov    $0x64,%edx
call   1070 <memcpy@plt>
lea    -0x220(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xdad(%rip),%rdi
mov    $0x64,%edx
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0xdab(%rip),%ax
mov    %ax,-0x223(%rbp)
mov    0xda0(%rip),%al
mov    %al,-0x221(%rbp)
lea    -0x223(%rbp),%rsi
lea    0xd38(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd71(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main01>:
push   %rbx
sub    $0x1c0,%rsp
movb   $0x63,0xe(%rsp)
movw   $0x6261,0xc(%rsp)
lea    0xf09(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movl   $0x0,0x140(%rsp)
movw   $0x6261,0xe0(%rsp)
movb   $0x63,0xe2(%rsp)
63
lea    0xeb0(%rip),%rdi
lea    0xe0(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movw   $0x0,0xd0(%rsp)
movl   $0x30626131,0xa0(%rsp)
31 61 62 30
movb   $0x37,0xa4(%rsp)
37
lea    0xe6d(%rip),%rdi
lea    0xa0(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movw   $0x0,0x90(%rsp)
movw   $0x6131,0x60(%rsp)
movb   $0x62,0x62(%rsp)
movb   $0x37,0x64(%rsp)
lea    0xe32(%rip),%rdi
lea    0x60(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movw   $0x0,0x50(%rsp)
movw   $0x6131,0x20(%rsp)
movb   $0x62,0x22(%rsp)
movb   $0x37,0x24(%rsp)
lea    0xe00(%rip),%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
movabs $0x676a64736c6a67,%rax
mov    %rax,0x16(%rsp)
movabs $0x6a676c73646a6761,%rax
6c 67 6a
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rdi
call   1050 <strlen@plt>
lea    0xdde(%rip),%rbx
mov    $0xe,%edx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
movaps 0xd6e(%rip),%xmm0
movaps %xmm0,0x1a0(%rsp)
movaps 0xd4f(%rip),%xmm0
movaps %xmm0,0x190(%rsp)
movaps 0xd30(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
movaps 0xd11(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xcf2(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xcd3(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movl   $0x0,0x1b0(%rsp)
lea    0x150(%rsp),%rdi
call   1050 <strlen@plt>
mov    $0x64,%edx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd5d(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movb   $0x0,0xa(%rsp)
movw   $0x390a,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd37(%rip),%rdi
call   1060 <system@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main01.buf = [3 x i8] c"abc"
@.str = [10 x i8] c"buf = %s\0A\00"
@.str.1 = [11 x i8] c"buf2 = %s\0A\00"
@.str.2 = [11 x i8] c"buf5 = %s\0A\00"
@.str.3 = [11 x i8] c"buf6 = %s\0A\00"
@.str.4 = [11 x i8] c"buf7 = %s\0A\00"
@__const.main01.buf8 = [14 x i8] c"agjdslgjlsdjg\00"
@.str.5 = [26 x i8] c"strlen = %d, sizeof = %d\0A\00"
@__const.main01.buf9 = [100 x i8] c"agjdslgjlsdjg\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.6 = [5 x i8] c"test\00"
@__const.main01.str = [3 x i8] c"\0A9\00"
@.str.7 = [4 x i8] c"%s\0A\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [6 x i8] c"pause\00"
define i32 @main01() {
%1 = alloca [3 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [50 x i8]
%5 = alloca [50 x i8]
%6 = alloca [50 x i8]
%7 = alloca [14 x i8]
%8 = alloca [100 x i8]
%9 = alloca [3 x i8]
%10 = bitcast [3 x i8]* %1 to i8*
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = bitcast [100 x i8]* %2 to i8*
%14 = bitcast i8* %13 to <{ i8, i8, i8, [97 x i8] }>*
%15 = getelementptr inbounds <{ i8, i8, i8, [97 x i8] }>, <{ i8, i8, i8, [97 x i8] }>* %14, i32 0, i32 0
store i8 97, i8* %15
%16 = getelementptr inbounds <{ i8, i8, i8, [97 x i8] }>, <{ i8, i8, i8, [97 x i8] }>* %14, i32 0, i32 1
store i8 98, i8* %16
%17 = getelementptr inbounds <{ i8, i8, i8, [97 x i8] }>, <{ i8, i8, i8, [97 x i8] }>* %14, i32 0, i32 2
store i8 99, i8* %17
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = bitcast [100 x i8]* %3 to i8*
%21 = bitcast [50 x i8]* %4 to i8*
%22 = bitcast i8* %21 to <{ i8, i8, i8, i8, i8, [45 x i8] }>*
%23 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %22, i32 0, i32 0
store i8 49, i8* %23
%24 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %22, i32 0, i32 1
store i8 97, i8* %24
%25 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %22, i32 0, i32 2
store i8 98, i8* %25
%26 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %22, i32 0, i32 3
store i8 48, i8* %26
%27 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %22, i32 0, i32 4
store i8 55, i8* %27
%28 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %28)
%30 = bitcast [50 x i8]* %5 to i8*
%31 = bitcast i8* %30 to <{ i8, i8, i8, i8, i8, [45 x i8] }>*
%32 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %31, i32 0, i32 0
store i8 49, i8* %32
%33 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %31, i32 0, i32 1
store i8 97, i8* %33
%34 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %31, i32 0, i32 2
store i8 98, i8* %34
%35 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %31, i32 0, i32 4
store i8 55, i8* %35
%36 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %36)
%38 = bitcast [50 x i8]* %6 to i8*
%39 = bitcast i8* %38 to <{ i8, i8, i8, i8, i8, [45 x i8] }>*
%40 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %39, i32 0, i32 0
store i8 49, i8* %40
%41 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %39, i32 0, i32 1
store i8 97, i8* %41
%42 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %39, i32 0, i32 2
store i8 98, i8* %42
%43 = getelementptr inbounds <{ i8, i8, i8, i8, i8, [45 x i8] }>, <{ i8, i8, i8, i8, i8, [45 x i8] }>* %39, i32 0, i32 4
store i8 55, i8* %43
%44 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %44)
%46 = bitcast [14 x i8]* %7 to i8*
%47 = getelementptr inbounds [14 x i8], [14 x i8]* %7, i64 0, i64 0
%48 = call i32 @strlen(i8* %47)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %48, i64 14)
%50 = bitcast [100 x i8]* %8 to i8*
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%52 = call i32 @strlen(i8* %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %52, i64 100)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%55 = bitcast [3 x i8]* %9 to i8*
%56 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 0
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %56)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%59 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main01.buf = [3 x i8] c"abc"
@.str = [10 x i8] c"buf = %s\0A\00"
@.str.1 = [11 x i8] c"buf2 = %s\0A\00"
@.str.2 = [11 x i8] c"buf5 = %s\0A\00"
@.str.3 = [11 x i8] c"buf6 = %s\0A\00"
@.str.4 = [11 x i8] c"buf7 = %s\0A\00"
@__const.main01.buf8 = [14 x i8] c"agjdslgjlsdjg\00"
@.str.5 = [26 x i8] c"strlen = %d, sizeof = %d\0A\00"
@__const.main01.buf9 = [100 x i8] c"agjdslgjlsdjg\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.6 = [5 x i8] c"test\00"
@__const.main01.str = [3 x i8] c"\0A9\00"
@.str.9 = [6 x i8] c"pause\00"
define i32 @main01() {
%1 = alloca [3 x i8]
%2 = alloca [100 x i8]
%3 = alloca [50 x i8]
%4 = alloca [50 x i8]
%5 = alloca [50 x i8]
%6 = alloca [14 x i8]
%7 = alloca [100 x i8]
%8 = alloca [3 x i8]
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8 97, i8* %11
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 1
store i8 98, i8* %12
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 2
store i8 99, i8* %13
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
store i8 49, i8* %15
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 1
store i8 97, i8* %16
%17 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 2
store i8 98, i8* %17
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 3
store i8 48, i8* %18
%19 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 4
store i8 55, i8* %19
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%21 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
store i8 49, i8* %21
%22 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 1
store i8 97, i8* %22
%23 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 2
store i8 98, i8* %23
%24 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 4
store i8 55, i8* %24
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%26 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
store i8 49, i8* %26
%27 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 1
store i8 97, i8* %27
%28 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 2
store i8 98, i8* %28
%29 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 4
store i8 55, i8* %29
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%31 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%32 = call i32 @strlen(i8* %31)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %32, i64 14)
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%35 = call i32 @strlen(i8* %34)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %35, i64 100)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%38 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 0
%39 = call i32 @puts(i8* %38)
%40 = call i32 @putchar(i32 10)
%41 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}