#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*/ getchar();
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  printf("%x %X %#x\n", 31, 31, 31);
  printf("**%d**% d**% d**\n", 42, 42, -42);
  printf("**%5d**%5.3d**%05d**%05.3d**\n", 6, 6, 6, 6);
  printf("**%05d**\n", 6);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x1f,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x2a,%edx
mov    $0xffffffd6,%ecx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x6,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x6,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1f,%edx
mov    $0x1f,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x2a,%esi
mov    $0x2a,%edx
mov    $0xffffffd6,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
mov    $0x6,%esi
mov    $0x6,%edx
mov    $0x6,%ecx
mov    $0x6,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%x %X %#x\0A\00"
@.str.1 = [18 x i8] c"**%d**% d**% d**\0A\00"
@.str.2 = [30 x i8] c"**%5d**%5.3d**%05d**%05.3d**\0A\00"
@.str.3 = [10 x i8] c"**%05d**\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 31, i32 31, i32 31)
%3 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 42, i32 42, i32 -42)
%4 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 6, i32 6, i32 6, i32 6)
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 6)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%x %X %#x\0A\00"
@.str.1 = [18 x i8] c"**%d**% d**% d**\0A\00"
@.str.2 = [30 x i8] c"**%5d**%5.3d**%05d**%05.3d**\0A\00"
@.str.3 = [10 x i8] c"**%05d**\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 31, i32 31, i32 31)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 42, i32 42, i32 -42)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 6, i32 6, i32 6, i32 6)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 6)
%5 = tail call i32 (...) @getchar()
ret i32 0
}