#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 *, ...);
void format_integer_types() {
  char int8 = -120;
  short int16 = -12000;
  int int32 = -128768;
  long long int64 = -1287680975631242ll;
  printf("-------------------------------\n");
  printf("int8   = %d\n", int8);
  printf("int16  = %d\n", int16);
  printf("int32  = %d\n", int32);
  printf("int64  = %lld\n", int64);
  printf("uint8  = %u\n", int8);
  printf("uint16 = %u\n", int16);
  printf("uint32 = %u\n", int32);
  printf("uint64 = %llu\n", int64);
  printf("hex8   = 0x%2x\n", int8);
  printf("hex16  = 0x%4x\n", int16);
  printf("hex32  = 0x%8x\n", int32);
  printf("hex64  = 0x%16llx\n", int64);
  printf("-------------------------------\n");
  printf("Left justified:   |%-12d|\n", int32);
  printf("Right justified:  |%12d|\n", int32);
  printf("Variable justify: |%*d|\n", -12, int32);
  printf("Pad with zeroes:  |%012d|\n", int32);
  printf("Sign specifier:   |%+d|\n", 10);
  printf("Align specifier:  |% d|\n", 20);
}


x86 assembly (clang, -O0):
<format_integer_types>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x88,-0x1(%rbp)
movw   $0xd120,-0x4(%rbp)
movl   $0xfffe0900,-0x8(%rbp)
movabs $0xfffb6cdc68dd0c76,%rax
6c fb ff
mov    %rax,-0x10(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%esi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movswl -0x4(%rbp),%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movswl -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movswl -0x4(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edx
lea    0xeb1(%rip),%rdi
mov    $0xfffffff4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x14,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_integer_types>:
push   %r14
push   %rbx
push   %rax
lea    0x101f(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rdi
mov    $0xffffff88,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0xffffd120,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
mov    $0xfffe0900,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
movabs $0xfffb6cdc68dd0c76,%rbx
6c fb ff
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
mov    $0xffffff88,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
mov    $0xffffd120,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9c(%rip),%rdi
mov    $0xfffe0900,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe94(%rip),%rdi
mov    $0xffffff88,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
mov    $0xffffd120,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8e(%rip),%rdi
mov    $0xfffe0900,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe85(%rip),%rdi
mov    $0xfffe0900,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8d(%rip),%rdi
mov    $0xfffe0900,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe94(%rip),%rdi
mov    $0xfffffff4,%esi
mov    $0xfffe0900,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
mov    $0xfffe0900,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
mov    $0x14,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"-------------------------------\0A\00"
@.str.1 = [13 x i8] c"int8 = %d\0A\00"
@.str.2 = [13 x i8] c"int16 = %d\0A\00"
@.str.3 = [13 x i8] c"int32 = %d\0A\00"
@.str.4 = [15 x i8] c"int64 = %lld\0A\00"
@.str.5 = [13 x i8] c"uint8 = %u\0A\00"
@.str.6 = [13 x i8] c"uint16 = %u\0A\00"
@.str.7 = [13 x i8] c"uint32 = %u\0A\00"
@.str.8 = [15 x i8] c"uint64 = %llu\0A\00"
@.str.9 = [16 x i8] c"hex8 = 0x%2x\0A\00"
@.str.10 = [16 x i8] c"hex16 = 0x%4x\0A\00"
@.str.11 = [16 x i8] c"hex32 = 0x%8x\0A\00"
@.str.12 = [19 x i8] c"hex64 = 0x%16llx\0A\00"
@.str.13 = [27 x i8] c"Left justified: |%-12d|\0A\00"
@.str.14 = [26 x i8] c"Right justified: |%12d|\0A\00"
@.str.15 = [25 x i8] c"Variable justify: |%*d|\0A\00"
@.str.16 = [27 x i8] c"Pad with zeroes: |%012d|\0A\00"
@.str.17 = [25 x i8] c"Sign specifier: |%+d|\0A\00"
@.str.18 = [25 x i8] c"Align specifier: |% d|\0A\00"
define void @format_integer_types() {
%1 = alloca i8
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
store i8 -120, i8* %1
store i16 -12000, i16* %2
store i32 -128768, i32* %3
store i64 -1287680975631242, i64* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i16, i16* %2
%10 = sext i16 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = load i64, i64* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i64 %14)
%16 = load i8, i8* %1
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %17)
%19 = load i16, i16* %2
%20 = sext i16 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %22)
%24 = load i64, i64* %4
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i64 %24)
%26 = load i8, i8* %1
%27 = sext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 %27)
%29 = load i16, i16* %2
%30 = sext i16 %29 to i32
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %3
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i32 %32)
%34 = load i64, i64* %4
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i64 %34)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%37 = load i32, i32* %3
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %3
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %3
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0), i32 -12, i32 %41)
%43 = load i32, i32* %3
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0), i32 %43)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0), i32 10)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i32 20)
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"int8 = %d\0A\00"
@.str.2 = [13 x i8] c"int16 = %d\0A\00"
@.str.3 = [13 x i8] c"int32 = %d\0A\00"
@.str.4 = [15 x i8] c"int64 = %lld\0A\00"
@.str.5 = [13 x i8] c"uint8 = %u\0A\00"
@.str.6 = [13 x i8] c"uint16 = %u\0A\00"
@.str.7 = [13 x i8] c"uint32 = %u\0A\00"
@.str.8 = [15 x i8] c"uint64 = %llu\0A\00"
@.str.9 = [16 x i8] c"hex8 = 0x%2x\0A\00"
@.str.10 = [16 x i8] c"hex16 = 0x%4x\0A\00"
@.str.11 = [16 x i8] c"hex32 = 0x%8x\0A\00"
@.str.12 = [19 x i8] c"hex64 = 0x%16llx\0A\00"
@.str.13 = [27 x i8] c"Left justified: |%-12d|\0A\00"
@.str.14 = [26 x i8] c"Right justified: |%12d|\0A\00"
@.str.15 = [25 x i8] c"Variable justify: |%*d|\0A\00"
@.str.16 = [27 x i8] c"Pad with zeroes: |%012d|\0A\00"
@.str.17 = [25 x i8] c"Sign specifier: |%+d|\0A\00"
@.str.18 = [25 x i8] c"Align specifier: |% d|\0A\00"
@str.19 = [32 x i8] c"-------------------------------\00"
define void @format_integer_types() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.19, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 -120)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 -12000)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 -128768)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i64 -1287680975631242)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 -120)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 -12000)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 -128768)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i64 -1287680975631242)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 -120)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 -12000)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i32 -128768)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i64 -1287680975631242)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.19, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i32 -128768)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32 -128768)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0), i32 -12, i32 -128768)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0), i32 -128768)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0), i32 10)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i32 20)
ret void
}