#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) {
  double x = .00000123456789;
  int n = 12345;
  printf("This is a test\n");
  printf("This\tis\nanother\ttest\n\n");
  printf("Here is n: %d\n\n", n);
  printf("Here is x: %g\n", x);
  printf("Here is x: %f\n", x);
  printf("Here is x: %e\n\n", x);
  printf("Here are n (%d) and x (%g)\n", n, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x3039,-0x14(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xed3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xecf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xecb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
lea    0xec5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf3a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3d(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
mov    $0x3039,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
movsd  0xea5(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
movsd  0xe8f(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
movsd  0xe79(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x3039,%esi
movsd  0xe5e(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"This is a test\0A\00"
@.str.1 = [23 x i8] c"This\09is\0Aanother\09test\0A\0A\00"
@.str.2 = [16 x i8] c"Here is n: %d\0A\0A\00"
@.str.3 = [15 x i8] c"Here is x: %g\0A\00"
@.str.4 = [15 x i8] c"Here is x: %f\0A\00"
@.str.5 = [16 x i8] c"Here is x: %e\0A\0A\00"
@.str.6 = [28 x i8] c"Here are n (%d) and x (%g)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
store double 0x3EB4B66DC015E19B, double* %2
store i32 12345, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load double, double* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %8)
%10 = load double, double* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %10)
%12 = load double, double* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), double %12)
%14 = load i32, i32* %3
%15 = load double, double* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %14, double %15)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [16 x i8] c"Here is n: %d\0A\0A\00"
@.str.3 = [15 x i8] c"Here is x: %g\0A\00"
@.str.4 = [15 x i8] c"Here is x: %f\0A\00"
@.str.5 = [16 x i8] c"Here is x: %e\0A\0A\00"
@.str.6 = [28 x i8] c"Here are n (%d) and x (%g)\0A\00"
@str = [15 x i8] c"This is a test\00"
@str.7 = [22 x i8] c"This\09is\0Aanother\09test\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.7, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 12345)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double 0x3EB4B66DC015E19B)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double 0x3EB4B66DC015E19B)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), double 0x3EB4B66DC015E19B)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 12345, double 0x3EB4B66DC015E19B)
ret i32 0
}