#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ write(char *, int, int, int);
int main() {
  printf("Characters: %c %c \n", 'a', 65);
  printf("Decimals: %d %ld\n", 1977, 650000L);
  printf("Preceding with blanks: %10d \n", 1977);
  printf("Preceding with zeros: %010d \n", 1977);
  printf("Some different radices: %d %x %o %#x %#o \n", 100, 100, 100, 100,
         100);
  printf("floats: %4.2f %+.0e %E \n", 3.1416, 3.1416, 3.1416);
  printf("Width trick: %*d \n", 5, 10);
  printf("%s \n", "A string");
  write("args: %d %d %d\n", 1, 2, 3);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x61,%esi
mov    $0x41,%edx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x7b9,%esi
mov    $0x9eb10,%edx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x7b9,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x7b9,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x64,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
movsd  0xe4c(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
mov    $0x3,%al
call   1040 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0xedf(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <write@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    $0x61,%esi
mov    $0x41,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x9eb10,%edx
mov    $0x7b9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x7b9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x7b9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x64,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
mov    $0x64,%r8d
mov    $0x64,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeee(%rip),%rdi
movsd  0xe51(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
mov    $0x3,%al
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0xee4(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <write@plt>
mov    0x2dd5(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Characters: %c %c \0A\00"
@.str.1 = [18 x i8] c"Decimals: %d %ld\0A\00"
@.str.2 = [30 x i8] c"Preceding with blanks: %10d \0A\00"
@.str.3 = [30 x i8] c"Preceding with zeros: %010d \0A\00"
@.str.4 = [43 x i8] c"Some different radices: %d %x %o %#x %#o \0A\00"
@.str.5 = [25 x i8] c"floats: %4.2f %+.0e %E \0A\00"
@.str.6 = [19 x i8] c"Width trick: %*d \0A\00"
@.str.7 = [5 x i8] c"%s \0A\00"
@.str.8 = [9 x i8] c"A string\00"
@.str.9 = [16 x i8] c"args: %d %d %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 97, i32 65)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 1977, i64 650000)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 1977)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 1977)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), i32 100, i32 100, i32 100, i32 100, i32 100)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), double 3.141600e+00, double 3.141600e+00, double 3.141600e+00)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 5, i32 10)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @write(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 1, i32 2, i32 3)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@.str = [20 x i8] c"Characters: %c %c \0A\00"
@.str.1 = [18 x i8] c"Decimals: %d %ld\0A\00"
@.str.2 = [30 x i8] c"Preceding with blanks: %10d \0A\00"
@.str.3 = [30 x i8] c"Preceding with zeros: %010d \0A\00"
@.str.4 = [43 x i8] c"Some different radices: %d %x %o %#x %#o \0A\00"
@.str.5 = [25 x i8] c"floats: %4.2f %+.0e %E \0A\00"
@.str.6 = [19 x i8] c"Width trick: %*d \0A\00"
@.str.7 = [5 x i8] c"%s \0A\00"
@.str.8 = [9 x i8] c"A string\00"
@.str.9 = [16 x i8] c"args: %d %d %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 97, i32 65)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 1977, i64 650000)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 1977)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 1977)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), i32 100, i32 100, i32 100, i32 100, i32 100)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), double 3.141600e+00, double 3.141600e+00, double 3.141600e+00)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 5, i32 10)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%9 = tail call i32 @write(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 1, i32 2, i32 3)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}