#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 *, char);
int main() {
  int theint = 123;
  printf("%d\n", theint);
  long thelong = 123456789L;
  printf("%ld\n", thelong);
  unsigned theuint = 123U;
  printf("%u\n", theuint);
  unsigned long theulong = 123456789UL;
  printf("%lu\n", theulong);
  double thedouble = 123e-2;
  printf("%f\n", thedouble);
  int thehex = 0xA88BCF;
  printf("%x\n", thehex);
  char thechar = 'A';
  printf("c as char: %c\n", thechar);
  printf("c as int: %d\n", thechar);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
movsbl -0x8(%rbp),%esi
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
movq   $0x75bcd15,-0x10(%rbp)
07
movsbl -0x10(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x7b,-0x14(%rbp)
movsbl -0x14(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
movq   $0x75bcd15,-0x20(%rbp)
07
movsbl -0x20(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
movabs $0x3ff3ae147ae147ae,%rax
ae f3 3f
mov    %rax,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%eax
lea    0xe73(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
movl   $0xa88bcf,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
lea    0xe5e(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
movb   $0x41,-0x2d(%rbp)
lea    0xe4f(%rip),%rdi
movsbl -0x2d(%rbp),%esi
call   1030 <printf@plt>
lea    0xe4e(%rip),%rdi
movsbl -0x2d(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf17(%rip),%rdi
mov    $0x7b,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x15,%esi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x7b,%esi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x15,%esi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
mov    $0xffffffcf,%esi
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
lea    0xe96(%rip),%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
@.str.2 = [4 x i8] c"%u\0A\00"
@.str.3 = [5 x i8] c"%lu\0A\00"
@.str.4 = [4 x i8] c"%f\0A\00"
@.str.5 = [4 x i8] c"%x\0A\00"
@.str.6 = [15 x i8] c"c as char: %c\0A\00"
@.str.7 = [14 x i8] c"c as int: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
%6 = alloca double
%7 = alloca i32
%8 = alloca i8
store i32 0, i32* %1
store i32 123, i32* %2
%9 = load i32, i32* %2
%10 = trunc i32 %9 to i8
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %10)
store i64 123456789, i64* %3
%12 = load i64, i64* %3
%13 = trunc i64 %12 to i8
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext %13)
store i32 123, i32* %4
%15 = load i32, i32* %4
%16 = trunc i32 %15 to i8
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext %16)
store i64 123456789, i64* %5
%18 = load i64, i64* %5
%19 = trunc i64 %18 to i8
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8 signext %19)
store double 1.230000e+00, double* %6
%21 = load double, double* %6
%22 = fptosi double %21 to i8
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8 signext %22)
store i32 11045839, i32* %7
%24 = load i32, i32* %7
%25 = trunc i32 %24 to i8
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8 signext %25)
store i8 65, i8* %8
%27 = load i8, i8* %8
%28 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8 signext %27)
%29 = load i8, i8* %8
%30 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8 signext %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
@.str.2 = [4 x i8] c"%u\0A\00"
@.str.3 = [5 x i8] c"%lu\0A\00"
@.str.4 = [4 x i8] c"%f\0A\00"
@.str.5 = [4 x i8] c"%x\0A\00"
@.str.6 = [15 x i8] c"c as char: %c\0A\00"
@.str.7 = [14 x i8] c"c as int: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 123)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext 21)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext 123)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8 signext 21)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8 signext 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8 signext -49)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8 signext 65)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8 signext 65)
ret i32 0
}