#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*/ printf(char *, int);
int strlen(char *);
int main() {
  unsigned long a = 1245048;
  char c = 128;
  printf("c=%d\n", c);
  char aa[10];
  printf("%d\n", strlen(aa));
  printf("sizeof(int) = %d\n", sizeof(int));
  printf("sizeof(long) = %d\n", sizeof(long));
  printf("sizeof(*) = %d\n", sizeof(void *));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x12ff78,-0x10(%rbp)
movb   $0x80,-0x11(%rbp)
movsbl -0x11(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1b(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xeda(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
lea    0xea0(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
mov    $0xffffff80,%esi
call   1040 <printf@plt>
lea    0xe(%rsp),%rdi
call   1030 <strlen@plt>
lea    0xef1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"c=%d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [18 x i8] c"sizeof(int) = %d\0A\00"
@.str.3 = [19 x i8] c"sizeof(long) = %d\0A\00"
@.str.4 = [16 x i8] c"sizeof(*) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8
%4 = alloca [10 x i8]
store i32 0, i32* %1
store i64 1245048, i64* %2
store i8 -128, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 4)
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 8)
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 8)
ret i32 0
}

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