#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*/ str;
typedef int /*<<< orphan*/ q;
typedef int /*<<< orphan*/ p;
typedef int /*<<< orphan*/ n;

/* Variables and functions */
int /*<<< orphan*/ fun(char);
void *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char str[] = "http://www.ibegroup.com/";
  char s[100];
  char *p = str;
  int n = 10;
  void *q = malloc(100);
  printf("sizeof(str):%d\n", sizeof(str));
  printf("sizeof(p):%d\n", sizeof(p));
  printf("sizeof(n):%d\n", sizeof(n));
  printf("sizeof(q):%d\n", sizeof(q));
  fun(s[100]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeaf(%rip),%al
mov    %al,-0x8(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x98(%rbp)
movl   $0xa,-0x9c(%rbp)
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0xa8(%rbp)
lea    0xe80(%rip),%rdi
mov    $0x19,%esi
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
lea    0xe79(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
movsbl -0x2c(%rbp),%edi
call   1030 <fun@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x19,%esi
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1030 <fun@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [25 x i8] c"http://www.ibegroup.com/\00"
@.str = [16 x i8] c"sizeof(str):%d\0A\00"
@.str.1 = [14 x i8] c"sizeof(p):%d\0A\00"
@.str.2 = [14 x i8] c"sizeof(n):%d\0A\00"
@.str.3 = [14 x i8] c"sizeof(q):%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x i8]
%3 = alloca [100 x i8]
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i32 0, i32* %1
%7 = bitcast [25 x i8]* %2 to i8*
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
store i8* %8, i8** %4
store i32 10, i32* %5
%9 = call i8* @malloc(i32 100)
store i8* %9, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 25)
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 8)
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 4)
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 8)
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 100
%15 = load i8, i8* %14
%16 = call i32 @fun(i8 signext %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"sizeof(str):%d\0A\00"
@.str.1 = [14 x i8] c"sizeof(p):%d\0A\00"
@.str.2 = [14 x i8] c"sizeof(n):%d\0A\00"
@.str.3 = [14 x i8] c"sizeof(q):%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 25)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 8)
%5 = tail call i32 @fun(i8 signext poison)
ret i32 0
}