#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*/ pad3;
typedef int /*<<< orphan*/ pad2;
typedef int /*<<< orphan*/ pad1;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int main() {
  char pad1[10];
  char a[10];
  char pad2[10];
  char b[10];
  char pad3[10];
  memset(pad1, 0, sizeof(pad1));
  memset(pad2, 0, sizeof(pad2));
  memset(pad3, 0, sizeof(pad3));
  memset(a, 'a', 10);
  a[3] = 0;
  a[9] = 0;
  memset(b, 'b', 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0xa(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    -0x1e(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    -0x32(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    -0x14(%rbp),%rdi
mov    $0x61,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
movb   $0x0,-0x11(%rbp)
movb   $0x0,-0xb(%rbp)
lea    -0x28(%rbp),%rdi
mov    $0x62,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0x2e(%rsp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    0x24(%rsp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    0x6(%rsp),%rdi
mov    $0x61,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
movb   $0x0,0x9(%rsp)
movb   $0x0,0xf(%rsp)
lea    0x1a(%rsp),%rdi
mov    $0x62,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
%4 = alloca [10 x i8]
%5 = alloca [10 x i8]
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i8 signext 0, i32 10)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @memset(i8* %8, i8 signext 0, i32 10)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%11 = call i32 @memset(i8* %10, i8 signext 0, i32 10)
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%13 = call i32 @memset(i8* %12, i8 signext 97, i32 10)
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 3
store i8 0, i8* %14
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 9
store i8 0, i8* %15
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%17 = call i32 @memset(i8* %16, i8 signext 98, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
%4 = alloca [10 x i8]
%5 = alloca [10 x i8]
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%11 = call i32 @memset(i8* %6, i8 signext 0, i32 10)
%12 = call i32 @memset(i8* %8, i8 signext 0, i32 10)
%13 = call i32 @memset(i8* %10, i8 signext 0, i32 10)
%14 = call i32 @memset(i8* %7, i8 signext 97, i32 10)
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 3
store i8 0, i8* %15
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 9
store i8 0, i8* %16
%17 = call i32 @memset(i8* %9, i8 signext 98, i32 10)
ret i32 0
}