#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*/ memset(char *, int, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char test[80] = "select foo, bar ,baz from mytable ; ";
  printf("%s \n", test);
  memset(test, 1, 6);
  printf("%s \n", test);
  memset(test, 7, 12);
  printf("%s \n", test);
  memset(test, 13, 20);
  printf("%s \n", test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rsi
lea    0xef1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x1,%esi
mov    $0x6,%edx
call   1040 <memset@plt>
lea    -0x60(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x7,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
lea    -0x60(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    $0xd,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x60(%rbp),%rsi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movaps 0xf12(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef6(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee7(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x6,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.test = [80 x i8] c"select foo, bar ,baz from mytable ; \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 = [5 x i8] c"%s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = bitcast [80 x i8]* %2 to i8*
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i32 1, i32 6)
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%11 = call i32 @memset(i8* %10, i32 7, i32 12)
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%15 = call i32 @memset(i8* %14, i32 13, i32 20)
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test = [80 x i8] c"select foo, bar ,baz from mytable ; \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 = [5 x i8] c"%s \0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @memset(i8* %2, i32 1, i32 6)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = call i32 @memset(i8* %2, i32 7, i32 12)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 @memset(i8* %2, i32 13, i32 20)
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}