#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*/ s;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ printf(char *, int, int);
int strlen(char *);
int main() {
  char *s = "1234567890";
  char buf[10];
  bzero(buf, sizeof(buf));
  printf("sizeof : %d\nstrlen : %d\n", sizeof(s), strlen(s));
  printf("sizeof : %d\nstrlen : %d\n", sizeof(buf), strlen(buf));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x1a(%rbp),%rdi
mov    $0xa,%esi
call   1050 <bzero@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
lea    0xea1(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
lea    -0x1a(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
lea    0xe85(%rip),%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xe(%rsp),%r14
mov    %r14,%rdi
mov    $0xa,%esi
call   1050 <bzero@plt>
lea    0xeb0(%rip),%rdi
call   1030 <strlen@plt>
lea    0xeaf(%rip),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"1234567890\00"
@.str.1 = [25 x i8] c"sizeof : %d\0Astrlen : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [10 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @bzero(i8* %4, i32 10)
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 %7)
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"1234567890\00"
@.str.1 = [25 x i8] c"sizeof : %d\0Astrlen : %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @bzero(i8* %2, i32 10)
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 %4)
%6 = call i32 @strlen(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 %6)
ret i32 0
}