#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*/ line;

/* Variables and functions */
int mylen(char *);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main(int argc, const char *argv[]) {
  char line[] = "hello";
  printf("strlen=%d\n", strlen(line));
  printf("strlen=%d\n", mylen(line));
  printf("sizeof=%d", sizeof(line));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb4(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xeae(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x16(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
lea    -0x16(%rbp),%rdi
call   1030 <mylen@plt>
mov    %eax,%esi
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
lea    0xe82(%rip),%rdi
mov    $0x6,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movw   $0x6f,0x4(%rsp)
movl   $0x6c6c6568,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0xeb2(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %r14,%rdi
call   1030 <mylen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x6,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.line = [6 x i8] c"hello\00"
@.str = [11 x i8] c"strlen=%d\0A\00"
@.str.1 = [10 x i8] c"sizeof=%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [6 x i8]* %6 to i8*
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %6, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %6, i64 0, i64 0
%12 = call i32 @mylen(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.line = [6 x i8] c"hello\00"
@.str = [11 x i8] c"strlen=%d\0A\00"
@.str.1 = [10 x i8] c"sizeof=%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @mylen(i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 6)
ret i32 0
}