#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(int argc, char *argv[]) {
  int legs = 4;
  static float pi = 3.1416f;
  double moondis = 384400123.459;
  char a_starts = 'A';
  char fname[] = "Flash";
  char lname[] = "Gordon";
  char *p = fname;
  printf("My cat has %d legs.\n", legs);
  printf("Pi equals ~%f.\n", pi);
  printf("The distance to the moon is %f meters.\n", moondis);
  printf("The alphabet starts with an %c.\n", a_starts);
  printf("My first name is %s.\n", fname);
  printf("My last name is %s.\n", lname);
  printf("My full name is %s %s.\n", fname, lname);
  printf("The secound character of my first name is \"%c\".\n", *++p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movb   $0x41,-0x21(%rbp)
mov    0xec4(%rip),%eax
mov    %eax,-0x27(%rbp)
mov    0xebe(%rip),%ax
mov    %ax,-0x23(%rbp)
mov    0xeb6(%rip),%eax
mov    %eax,-0x2e(%rbp)
mov    0xeb0(%rip),%ax
mov    %ax,-0x2a(%rbp)
mov    0xea8(%rip),%al
mov    %al,-0x28(%rbp)
lea    -0x27(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0x2e98(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe8c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsbl -0x21(%rbp),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x27(%rbp),%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x2e(%rbp),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x27(%rbp),%rsi
lea    -0x2e(%rbp),%rdx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movsbl 0x1(%rax),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movw   $0x68,0xc(%rsp)
movl   $0x73616c46,0x8(%rsp)
73
movl   $0x6e6f64,0x13(%rsp)
movl   $0x64726f47,0x10(%rsp)
64
lea    0xee0(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
movsd  0xea8(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
movsd  0xe9a(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
lea    0x8(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x9(%rsp),%esi
lea    0xefa(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@main.pi = internal global float 0x400921FF20000000
@__const.main.fname = [6 x i8] c"Flash\00"
@__const.main.lname = [7 x i8] c"Gordon\00"
@.str = [21 x i8] c"My cat has %d legs.\0A\00"
@.str.1 = [16 x i8] c"Pi equals ~%f.\0A\00"
@.str.2 = [40 x i8] c"The distance to the moon is %f meters.\0A\00"
@.str.3 = [33 x i8] c"The alphabet starts with an %c.\0A\00"
@.str.4 = [22 x i8] c"My first name is %s.\0A\00"
@.str.5 = [21 x i8] c"My last name is %s.\0A\00"
@.str.6 = [24 x i8] c"My full name is %s %s.\0A\00"
@.str.7 = [49 x i8] c"The secound character of my first name is \22%c\22.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
%8 = alloca i8
%9 = alloca [6 x i8]
%10 = alloca [7 x i8]
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 4, i32* %6
store double 0x41B6E97AFB758106, double* %7
store i8 65, i8* %8
%12 = bitcast [6 x i8]* %9 to i8*
%13 = bitcast [7 x i8]* %10 to i8*
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
store i8* %14, i8** %11
%15 = load i32, i32* %6
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load float, float* @main.pi
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %18)
%20 = load double, double* %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), double %20)
%22 = load i8, i8* %8
%23 = sext i8 %22 to i32
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds [7 x i8], [7 x i8]* %10, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %27)
%29 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%30 = getelementptr inbounds [7 x i8], [7 x i8]* %10, i64 0, i64 0
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %29, i8* %30)
%32 = load i8*, i8** %11
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %11
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i32 %35)
ret i32 0
}

LLVM IR (-O2):
@__const.main.fname = [6 x i8] c"Flash\00"
@__const.main.lname = [7 x i8] c"Gordon\00"
@.str = [21 x i8] c"My cat has %d legs.\0A\00"
@.str.1 = [16 x i8] c"Pi equals ~%f.\0A\00"
@.str.2 = [40 x i8] c"The distance to the moon is %f meters.\0A\00"
@.str.3 = [33 x i8] c"The alphabet starts with an %c.\0A\00"
@.str.4 = [22 x i8] c"My first name is %s.\0A\00"
@.str.5 = [21 x i8] c"My last name is %s.\0A\00"
@.str.6 = [24 x i8] c"My full name is %s %s.\0A\00"
@.str.7 = [49 x i8] c"The secound character of my first name is \22%c\22.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i8]
%4 = alloca [7 x i8]
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 4)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double 0x400921FF20000000)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), double 0x41B6E97AFB758106)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 65)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %5)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %5, i8* %6)
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0), i32 %16)
ret i32 0
}