#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 main(void) {
  char *str = "ABCDEFGHIJKL";
  int *pInt = (int *)str;
  long *pLong = (long *)str;
  printf("%c\n%c\n%c\n", *(str + 1), *(char *)(pInt + 1), *(char *)(pLong + 1));
  char ch = 'a';
  int a = (int)ch;
  printf("%d %c\n", a, ch);
  int add = 0x123456;
  int *p = &add;
  printf("%d\n", *p);
  int pi = 3.14;
  int pi2 = 3.14;
  printf("PI is %f\n", 3.14);
  printf("pi is %d\n", pi);
  printf("pi2 is %d\n", pi2);
  char *string = "abcdef";
  printf("%s\n", string);
  printf("%d\n", *string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%esi
mov    -0x18(%rbp),%rax
movsbl 0x4(%rax),%edx
mov    -0x20(%rbp),%rax
movsbl 0x8(%rax),%ecx
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x61,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
movsbl -0x21(%rbp),%edx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x123456,-0x2c(%rbp)
lea    -0x2c(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3,-0x3c(%rbp)
movl   $0x3,-0x40(%rbp)
lea    0xe6e(%rip),%rdi
movsd  0xe40(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x3c(%rbp),%esi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%esi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe55(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
movsbl (%rax),%esi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee0(%rip),%rdi
mov    $0x42,%esi
mov    $0x45,%edx
mov    $0x49,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x61,%esi
mov    $0x61,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed7(%rip),%rbx
mov    %rbx,%rdi
mov    $0x123456,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea6(%rip),%rdi
movsd  0xe85(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x61,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"ABCDEFGHIJKL\00"
@.str.1 = [10 x i8] c"%c\0A%c\0A%c\0A\00"
@.str.2 = [7 x i8] c"%d %c\0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [10 x i8] c"PI is %f\0A\00"
@.str.5 = [10 x i8] c"pi is %d\0A\00"
@.str.6 = [11 x i8] c"pi2 is %d\0A\00"
@.str.7 = [7 x i8] c"abcdef\00"
@.str.8 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i64*
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
%12 = load i8*, i8** %2
%13 = bitcast i8* %12 to i32*
store i32* %13, i32** %3
%14 = load i8*, i8** %2
%15 = bitcast i8* %14 to i64*
store i64* %15, i64** %4
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 1
%22 = bitcast i32* %21 to i8*
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = load i64*, i64** %4
%26 = getelementptr inbounds i64, i64* %25, i64 1
%27 = bitcast i64* %26 to i8*
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %24, i32 %29)
store i8 97, i8* %5
%31 = load i8, i8* %5
%32 = sext i8 %31 to i32
store i32 %32, i32* %6
%33 = load i32, i32* %6
%34 = load i8, i8* %5
%35 = sext i8 %34 to i32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %33, i32 %35)
store i32 1193046, i32* %7
store i32* %7, i32** %8
%37 = load i32*, i32** %8
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %38)
store i32 3, i32* %9
store i32 3, i32* %10
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double 3.140000e+00)
%41 = load i32, i32* %9
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %10
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %43)
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8** %11
%45 = load i8*, i8** %11
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %45)
%47 = load i8*, i8** %11
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %49)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"%c\0A%c\0A%c\0A\00"
@.str.2 = [7 x i8] c"%d %c\0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [10 x i8] c"PI is %f\0A\00"
@.str.5 = [10 x i8] c"pi is %d\0A\00"
@.str.6 = [11 x i8] c"pi2 is %d\0A\00"
@.str.7 = [7 x i8] c"abcdef\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 66, i32 69, i32 73)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 97, i32 97)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 1193046)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), double 3.140000e+00)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 3)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 3)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 97)
ret i32 0
}